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

[Question] Resume of training from saved model does not give similar result #326

Closed
kmsgnnew opened this issue Feb 22, 2021 · 3 comments
Closed
Labels
custom gym env Issue related to Custom Gym Env more information needed Please fill the issue template completely question Further information is requested RTFM Answer is the documentation

Comments

@kmsgnnew
Copy link

kmsgnnew commented Feb 22, 2021

Question

Does Resume training from saved model give similar results in stable baseline 3??

Additional context

A model is trained for 10 epochs, model is saved at 5 epochs then loaded using DQN.load() and then training is continued with model.learn for another 5 epoch. This continuation does not match for me. does it match for anyone or is it still not supported

Note: 1 epoch is over entire dataset

I have already seen similar issue comments in stable baseline at
hill-a/stable-baselines#692
hill-a/stable-baselines#301

@kmsgnnew kmsgnnew added the question Further information is requested label Feb 22, 2021
@kmsgnnew kmsgnnew changed the title [Question] Resume training from saved model [Question] Resume of training from saved model does not give similar result Feb 22, 2021
@araffin araffin added more information needed Please fill the issue template completely RTFM Answer is the documentation labels Feb 22, 2021
@araffin
Copy link
Member

araffin commented Feb 22, 2021

Hello,
have you saved the replay buffer? (cf doc)
have you make sure that the exploration factor (epsilon) starts at the same value it ended?

It is hard to compare training policy, better to compare deterministic ones, usually used for evaluation (cf doc).

Please provide a minimal working example (cf issue template)

@araffin araffin added the custom gym env Issue related to Custom Gym Env label Feb 22, 2021
@kmsgnnew
Copy link
Author

kmsgnnew commented Feb 22, 2021

thanks araffin for quick reply.

as I understand adding following two changes should improve:

  1. {have you saved the replay buffer?}

save_replay_buffer while training and then first load model using DQN.load() also load_replay_buffer from pickle file

  1. { have you make sure that the exploration factor (epsilon) starts at the same value it ended? }

for ensuring exploration factor (epsilon) starts at the same value it ended.

mean_params = model.get_parameters()
save this dictonary.
DQN.load() also set_parameters(load_path_to_dictonary)

@araffin
Copy link
Member

araffin commented Mar 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom gym env Issue related to Custom Gym Env more information needed Please fill the issue template completely question Further information is requested RTFM Answer is the documentation
Projects
None yet
Development

No branches or pull requests

2 participants