reid-strong-baseline
reid-strong-baseline copied to clipboard
test时出现问题
测试时导入训练好的模型: model.load_param(cfg.TEST.WEIGHT) 出现问题: File "tools/test.py", line 61, in main model.load_param(cfg.TEST.WEIGHT) File "./modeling/baseline.py", line 179, in load_param for i in param_dict: TypeError: 'Baseline' object is not iterable
I meet a similar problem that I cannot load my trained data, always show this problem. I choose different version about some pkg, but it is doesn't work.
Problem hits: File "tools/test.py", line 64, in main model.load_param(cfg.TEST.WEIGHT) File "./modeling/baseline.py", line 182, in load_param self.state_dict()[i].copy_(param_dict[i]) KeyError: 'model'
Please refer to https://github.com/michuanhaohao/reid-strong-baseline/issues/101#issuecomment-556838939
I meet a similar problem that I cannot load my trained data, always show this problem. I choose different version about some pkg, but it is doesn't work.
Problem hits: File "tools/test.py", line 64, in main model.load_param(cfg.TEST.WEIGHT) File "./modeling/baseline.py", line 182, in load_param self.state_dict()[i].copy_(param_dict[i]) KeyError: 'model'
hi! Have you ever done it?I have run this baseline and got the same problem.But it doesn't work after I tried the every solutions in #101 (comment) and other comments in issues.
Problem hits:
Traceback (most recent call last):
File "tools/test.py", line 67, in
same problem, have you already solved?
I meet a similar problem that I cannot load my trained data, always show this problem. I choose different version about some pkg, but it is doesn't work. Problem hits: File "tools/test.py", line 64, in main model.load_param(cfg.TEST.WEIGHT) File "./modeling/baseline.py", line 182, in load_param self.state_dict()[i].copy_(param_dict[i]) KeyError: 'model'
hi! Have you ever done it?I have run this baseline and got the same problem.But it doesn't work after I tried the every solutions in #101 (comment) and other comments in issues.
Problem hits: Traceback (most recent call last): File "tools/test.py", line 67, in main() File "tools/test.py", line 61, in main model.load_param(cfg.TEST.WEIGHT) File "./modeling/baseline.py", line 179, in load_param self.state_dict()[i].copy_(param_dict[i]) KeyError: 'model'
change as below can solve the issue
def load_param(self, trained_path):
print("trained_path ", trained_path)
param_dict = torch.load(trained_path)
for i in param_dict['model']:
if 'classifier' in i:
continue
if 'model' in i:
continue
self.state_dict()[i].copy_(param_dict['model'][i])