Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of ScheduledOptim #8

Open
zhenghuanghe opened this issue Jul 16, 2021 · 11 comments
Open

lack of ScheduledOptim #8

zhenghuanghe opened this issue Jul 16, 2021 · 11 comments

Comments

@zhenghuanghe
Copy link

zhenghuanghe commented Jul 16, 2021

image

“ScheduledOptim” is not defined in modules.Whether the content is missing?

@guxd
Copy link
Owner

guxd commented Jul 18, 2021

It seems that the code you are running is inconsistent with the Github repository.

image

Can you double-check?

@zhenghuanghe
Copy link
Author

I downloaded the latest version and download dataset from google drive. When I running train.py.There are still some problems when I running train.py.
%X5XS_~}2(7@{4(HOXIQK2J
It seems that the data type is not matching.I change my environment python=3.6 and Pytorch=0.4.1 as the README.md.The problem is not solved. Can you give me the current environment?

@guxd
Copy link
Owner

guxd commented Dec 3, 2021

Can you print the size and content of inputs before calling inputs = self.word_embedder(inputs) in modules.py? Can you check whether they are word indices or sequence lengths?

@zhenghuanghe
Copy link
Author

image
the type of inputs is int32

@guxd
Copy link
Owner

guxd commented Dec 3, 2021

How about brutally casting the inputs to long such asinputs = inputs.long()?

@zhenghuanghe
Copy link
Author

ZCQ{9HZ1C_ M3WPY}LBPI$P
Thanks your help!
There are so many place has this problem .I chang the data type from int32 to long in train.py line 114 .It can work now.
EQ9$% V0YJL{{ )~%_1ENXS

But I don't know if it will have an unpredictable effect on the result.Because the source code your share don‘t need to change the tensor type in your environment.

@guxd
Copy link
Owner

guxd commented Dec 3, 2021

It can be OK. It might be caused by the Line 53-54 in data_loader.py. Can you try to change the argument np.int to np.long?

@zhenghuanghe
Copy link
Author

I chang np.int to np.long but result is same .
image

@zhenghuanghe
Copy link
Author

Dear author,I change the np.int to np.int64 and the problem was solved. My problem might be caused by numpy version.
When I train the model,I find that it needs nearly 22 hours to train an epoch.It takes too much time.Is it normal to consume such a long time? My GPU is GTX2060 and use default configuration in config.py,GPU usage is not high during training.

@guxd
Copy link
Owner

guxd commented Dec 8, 2021

Thanks for reporting this solution.
Yes, it is normal to cost such a long time for training an epoch.

@zhenghuanghe
Copy link
Author

My result is Avg recall BLEU 28.139705, avg precision BLEU 28.139705, F1 28.139705.
There seems to be something wrong with my training.
Can you provide a trained model ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants