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

Cannot find checkpoint in eval_low_res_given_prompt.py #1

Open
zheminzhang96 opened this issue Sep 19, 2024 · 6 comments
Open

Cannot find checkpoint in eval_low_res_given_prompt.py #1

zheminzhang96 opened this issue Sep 19, 2024 · 6 comments

Comments

@zheminzhang96
Copy link

I tried to load the trained model weights obtained from your Google drive in trainer.load(-1) eval_low_res_given_prompt.py. But got the following errors:
error_msg

@CugAgo
Copy link

CugAgo commented Jan 6, 2025

Have you solved this problem?

@zheminzhang96
Copy link
Author

Have you solved this problem?

yes.

@CugAgo
Copy link

CugAgo commented Jan 7, 2025

I think in the load function, it is necessary to load the ckpt weight file, but the downloaded file is in pin format. Have you modified the code? How do you read the weights?
Thank you for your reply.

@zheminzhang96
Copy link
Author

I think in the load function, it is necessary to load the ckpt weight file, but the downloaded file is in pin format. Have you modified the code? How do you read the weights? Thank you for your reply.

Yes, I modified code. I provided the .bin path as checkpoint_path. Then used torch.load(...) instead of accelerator.load_state(...)
medsyn_load

@CugAgo
Copy link

CugAgo commented Jan 8, 2025

I think in the load function, it is necessary to load the ckpt weight file, but the downloaded file is in pin format. Have you modified the code? How do you read the weights? Thank you for your reply.

Yes, I modified code. I provided the .bin path as checkpoint_path. Then used torch.load(...) instead of accelerator.load_state(...) medsyn_load

If use ema_model.load_state_dict() instead of accelerator.load_state(...). Does the accelerator in the model still need to load parameters? Do the accelerators in the model still need to load parameters, or do it also need to load the checkpoint?
image

Thank you!

@CugAgo
Copy link

CugAgo commented Jan 8, 2025

I think in the load function, it is necessary to load the ckpt weight file, but the downloaded file is in pin format. Have you modified the code? How do you read the weights? Thank you for your reply.

Yes, I modified code. I provided the .bin path as checkpoint_path. Then used torch.load(...) instead of accelerator.load_state(...) medsyn_load

If use ema_model.load_state_dict() instead of accelerator.load_state(...). Does the accelerator in the model still need to load parameters? Do the accelerators in the model still need to load parameters, or do it also need to load the checkpoint? image

Thank you!

I have solved this problem and it seems that there is no need to load parameters for accelerator, so it can run correctly. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants