SA-SSD
SA-SSD copied to clipboard
KeyError: 'model_state' ----- evaluate the the pretrained model
I download the pretrained model, and evaluate the model: cd tools python3 test.py ../configs/car_cfg.py ../saved_model_vehicle/epoch_50.pth
Then the error occur:
==> Loading parameters from checkpoint ../saved_model_vehicle/epoch_50.pth to GPU
Traceback (most recent call last):
File "test.py", line 159, in
Does anyone know how to solve this problem? Thank you very much!
You should change key to load model. Print checkpoint.keys() first to see options, and choice right one. BTW after that you got load weights problem, caused my DataParallel apply - easy add 'model.' at the start of weights alias/key in OrderedDict in model state.
I download the pretrained model, and evaluate the model: cd tools python3 test.py ../configs/car_cfg.py ../saved_model_vehicle/epoch_50.pth
Then the error occur:
==> Loading parameters from checkpoint ../saved_model_vehicle/epoch_50.pth to GPU Traceback (most recent call last): File "test.py", line 159, in main() File "test.py", line 141, in main load_params_from_file(model, args.checkpoint) File "/home/zzz/SA-SSD/tools/train_utils/init.py", line 157, in load_params_from_file model_state_disk = checkpoint['model_state'] KeyError: 'model_state'
Does anyone know how to solve this problem? Thank you very much!
I also meet this problem. Have you solved it ?
https://github.com/skyhehe123/SA-SSD/issues/19#issuecomment-619886333 @mengxingshifen1218
@mengxingshifen1218: Can you share how to solve your model_state issue using the comment #19 (comment) from @stalkermustang? Thanks.
@mengxingshifen1218: Can you share how to solve your model_state issue using the comment #19 (comment) from @stalkermustang? Thanks.
You can train this model by yourself,it will be ok.
Check my answer at duplicate issue. I have provided code to load pretrained model without any training there.