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

ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group #63

Open
gggah opened this issue Jul 15, 2024 · 0 comments

Comments

@gggah
Copy link

gggah commented Jul 15, 2024


ValueError Traceback (most recent call last)
in
37 model=score_model, ema=ema)
38
---> 39 state = restore_checkpoint(ckpt_filename, state, config.device)
40 ema.copy_to(score_model.parameters())

/workspace/utils.py in restore_checkpoint(ckpt_dir, state, device)
13 else:
14 loaded_state = torch.load(ckpt_dir, map_location=device)
---> 15 state['optimizer'].load_state_dict(loaded_state['optimizer'])
16 state['model'].load_state_dict(loaded_state['model'], strict=False)
17 state['ema'].load_state_dict(loaded_state['ema'])

/opt/conda/lib/python3.8/site-packages/torch/optim/optimizer.py in load_state_dict(self, state_dict)
144 saved_lens = (len(g['params']) for g in saved_groups)
145 if any(p_len != s_len for p_len, s_len in zip(param_lens, saved_lens)):
--> 146 raise ValueError("loaded state dict contains a parameter group "
147 "that doesn't match the size of optimizer's group")
148

ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group

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

1 participant