-
Notifications
You must be signed in to change notification settings - Fork 728
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
Loss is inf or nan, bug?, example file attached! #678
Comments
The problem returned, so reopening this |
Perhaps noone answers this thread because you cannot reproduce the behaviour. I wrote a file that produces the nan values, attached. Please help me! |
Although that code adds |
I don't understand. As stated above the NaNs definititely produce the error during training. How can I make that error description better for you? |
What I meant is that code shouldn't be the cause of the When you run any of the existing examples do you see a similar error? or it just in your specific example? |
Training the agent often fails with message "Loss is inf or nan". I found another thread where missing normalization was the culprit. I don't know what that is about, I could find nothing about normalization in the documentation (but maybe I just searched wrong). Can you clear this up for me?
Debugging shows
dqn_agent.py, l. 451: transition = self._as_transition(experience)
calls
data_converter.py, l. 423: value = trajectory.to_n_step_transition(value, gamma=self._gamma)
calls
trajectory.py, l. 780 - 787
which create nans in time_steps
After that in
dqn_agent.py, l. 456, l. 469 and 471 (q_values,td_error,td_loss)
gives back those nans into the loss.
So trajectory.py l. 780 - 787 are the responsible lines. In a working case they don't produce nan. Their code exactly is
The text was updated successfully, but these errors were encountered: