reid-strong-baseline: Error on Test
Hi, I run the code for testing and got an error.
python3 tools/test.py --config_file='configs/softmax_triplet.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('/media/user/DATA/reid-strong-baseline/log/resnet50_model_40.pth')"
File “tools/test.py”, line 61, in main model.load_param(cfg.TEST.WEIGHT) File “/media/user/DATA/reid-strong-baseline/modeling/baseline.py”, line 176, in load_param for i in param_dict: TypeError: ‘Baseline’ object is not iterable
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (5 by maintainers)
Hi. Unfortunately I have the same problem. Python 3.6.9 Pytorch 1.2.0 ignite 0.1.2
EDIT: solved by editing line 178 of baseline.py to:
for i in param_dict.parameters(): # added .parameters()
EDIT2: I was getting very poor performance (~1% acc on test vs ~95% acc reported after train) with the above hack so after some investigation that’s how the load_param function in baseline.py should actually look like:I have an similar error on test:
the problem occured because i used resnet50_optimizer_120.pth not resnet50_model_120.pth Hope it helps someone.
Now i have the same error like you
I will try your solution
Thanks to the @TomKomar recommendation, changing
load_param
function in directory./modeling/baseline.py
to the following code solved the problem.@TomKomar just check it. Your solution is useful in pytorch 0.4.1. Good job !!!