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

[BUG] How to continue training from a save checkpoint #396

Closed
zoctipus opened this issue May 20, 2024 · 2 comments
Closed

[BUG] How to continue training from a save checkpoint #396

zoctipus opened this issue May 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zoctipus
Copy link

zoctipus commented May 20, 2024

Describe the bug
I wanted resume the training from a saved checkpoint
Screenshot from 2024-05-19 16-03-25

The green curve is previously trained model
The red curve is restart of the training after loading 450M steps check point of green curve by the following curve.

As you can see the red curve looks like it didn't load the weight at all as it pattern matches a curve that trained from scratch

below code is how I loaded the model

sac.build_with_env(env)
sac.load_model(os.path.join(MODEL_DIR,'policy.pt'))
sac.fit_online(env, buffer, n_steps=5000000, n_steps_per_epoch=10000,random_steps = 5000, \
	logdir=OUT_DIR,eval_env=env, tensorboard_dir=OUT_DIR+'/logs',save_interval=10, utd=UTD)

I wanted to ask if the above code is how resume training works in d3rlpy, and if not, how to resume training the modeling from a checkpoint with the epoch, learning rate, entropy...etc that left from the checkpoint. Thank you!

@zoctipus zoctipus added the bug Something isn't working label May 20, 2024
@takuseno
Copy link
Owner

Yeah, your code seems right. Probably, you should drop random_steps option since your policy is pretrained.

@takuseno
Copy link
Owner

takuseno commented Jun 1, 2024

I believe that you should be able to get the expected performance by dropping random_steps. Let me close this issue. Feel free to reopen this if there is any further discussion.

@takuseno takuseno closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants