1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Traceback (most recent call last): File "tools/train.py", line 98, in <module> main() File "tools/train.py", line 94, in main logger=logger) File "/home/omnisky/Code/redet-improve-new/mmdet/apis/train.py", line 61, in train_detector _non_dist_train(model, dataset, cfg, validate=validate) File "/home/omnisky/Code/redet-improve-new/mmdet/apis/train.py", line 194, in _non_dist_train runner.resume(cfg.resume_from) File "/home/omnisky/anaconda3/envs/redet/lib/python3.7/site-packages/mmcv-0.2.13-py3.7-linux-x86_64.egg/mmcv/runner/runner.py", line 313, in resume self.optimizer.load_state_dict(checkpoint['optimizer']) File "/home/omnisky/anaconda3/envs/redet/lib/python3.7/site-packages/torch/optim/optimizer.py", line 116, in load_state_dict raise ValueError("loaded state dict contains a parameter group " ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group |
解决方法(注意文件路径):
vi ~/anaconda3/envs/环境名/lib/python3.7/site-packages/mmcv-0.2.13-py3.7-linux-x86_64.egg/mmcv/runner/runner.py
把这行代码注释掉:
1 2 |
# if 'optimizer' in checkpoint and resume_optimizer: # self.optimizer.load_state_dict(checkpoint['optimizer']) |
重新跑就可以了。
本文最后更新于2021年5月20日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!