openseg-group / openseg.pytorch

The official Pytorch implementation of OCNet, OCRNet, and SegFix.
MIT License
1.19k stars 140 forks source link

Unexpected key(s) in state_dict: "config_dict", "state_dict". #86

Closed sahamitul closed 2 years ago

sahamitul commented 2 years ago

I run this command for inference on an image:-

python main.py --configs configs/coco_stuff/H_48_D_4_TEST.json --pretrained models_downloaded/hrnet_w48_ocr_hrnet48_ohem_2_latest.pth --test_img test.jpg --out_dir ./output/

And get this crash:- Unexpected key(s) in state_dict: "config_dict", "state_dict".

Any help please? Thanks!

PkuRainBow commented 2 years ago

Thanks for your interest in our work!

I would recommend debugging the error in the module_helper.py:

https://github.com/openseg-group/openseg.pytorch/blob/2c459f3b42deee26194f1802f353887d945e14c4/lib/models/tools/module_helper.py#L123

Sorry for the inconvenience as we haven't maintained this code for a long time.