Skip to content

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

Description

@gggah

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions