-
Notifications
You must be signed in to change notification settings - Fork 1.7k
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Bug] Inconsistencies with EvalCallback
tensorboard logs. Logs are written at timesteps different from the ones at which were recorded..
#457
Comments
EvalCallback
logs. Logs are written at timesteps different from the ones at which were recorded..EvalCallback
tensorboard logs. Logs are written at timesteps different from the ones at which were recorded..
Hello,
The reason behind it is how those algorithms work. Overall, Tensorboard should be used only for visualization, for proper comparison please use the logs generated by the callbacks. We have scripts in the RL zoo training framework to make those comparison plots.
Is that really a big issue when visualizing different runs?
For that, you can simply give a larger training budget to make sure the latest evaluation is logged.
Something can be probably done for that one though (moving the break after the logging part). |
Hello,
Maybe I'm naive, but wouldn't dumping the logs with
Another solution could be splitting the logger's memory into different sections that can be dumped asynchronously.
Well in this case it's not, because this is a dummy example to highlight the bug, but when I came accross this inconsistency for the first time It was skewing the visualization and our interpretation of the results, so yes.
Not if I am using
Sorry, I meant |
good point, this should do the trick (even though it would log only the eval in the terminal but I think that's ok) We would welcome a PR that fixes this issue then ;) |
Working on it. |
* Make EvalCallback dump the evaluation logs it records #457. * Make test deterministic Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
* Make EvalCallback dump the evaluation logs it records DLR-RM#457. * Make test deterministic Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
🐛 Bug
EvalCallback
records logs that can be used with Tensorboad, but does not dump them.These logs remain recorded and are written by the
Algorithm
when it dumps its rollout logs during training. However, this will not necessarily happen at the timestepEvalCallback
recorded its logs, resulting in those evaluation logs being recorded with the wrong timestep.Synchronizing
EvalCallback
recordings with theAlgorithm
log dumping is someimes not possible asEvalCallback
records the evaluation every n timesteps but some algorithms likeDQN
dump their rollout logs every n episodes.Moreover, even with
PPO
which records its rollout logs every n rollout steps, settingEvalCallback
to recording every n rollout steps leads to the last evaluation logs (if using aStopTrainingOnRewardThreshold
callback) not beingrecordeddumped, as the rollout is interrupted.To Reproduce
Problems:
num_timesteps=10000
written withtimestep=10047
.Expected behavior
EvalCallback
's logs should be written with the timestep at which they were recorded (i.e. at the timestep the environment was evaluated).This should be consistent irrespectively from the
Algorithm
used for the training.Checklist
The text was updated successfully, but these errors were encountered: