-
Notifications
You must be signed in to change notification settings - Fork 30
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
reward turns to nan #2
Comments
Do the reward and loss become 'nan' all the time? At which step? |
I met the same problem... |
I finally found that I met the same problem as you,when it trys to generate words in beam(), the new_hyp_scores turn to nan at about 1000 steps, then I changed the learning rate, from 1e-3 to 1e-5 as suggested above,it worked well longer than before, I think the result shows that the nmt model must be train more,and next step I want to change the optimizer,such as adam. If you find some useful methods, please tell me how to do it.Thank you :) |
We have tired adam before, but the result was bad. |
After several steps(about 20), with learning rate of 1e-6(maybe small enough... 1e-3 is also tried, and loss turned to nan after 2 steps, even before saving a model...), the loss turns to nan again... |
|
I think the Nan problem comes from the reward calculation, because the reward is divided by std but std can be zero, so changing the reward form may solve the problem. |
I also meet with this problem. Has anyone found any method to solve this? |
As training moves on, the reward and loss all become 'nan'. Has this problem existed in your data?
A -> B
('[s]', 'Old power means the fossil ##AT##-##AT## nuclear energies : oil , natural gas , coal and uranium exploited in centralised , monopolistic energy systems supported by short ##AT##-##AT## term thinking politics .')
('[smid]', '
Interaktion Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Fachkompetenz Schecks')r1= nan r2= nan rk= nan fw_loss= nan bw_loss= nan
A loss = nan B loss = nan
The text was updated successfully, but these errors were encountered: