score_sde_pytorch icon indicating copy to clipboard operation
score_sde_pytorch copied to clipboard

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

Open gggah opened this issue 1 year ago • 0 comments


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

gggah avatar Jul 15 '24 14:07 gggah