Hello!
Thank you for your work!
I installed mmdetection, but when I try to start the prediction I get an error __init__() got an unexpected keyword argument 'bbox_roi_extractor
I tried using a docker file, but I get the same result.
Reproduction
init_detectorTorchVision: 0.5.0+cu100
OpenCV: 4.2.0
MMCV: 0.5.5
MMDetection: 2.0.0+9f8c002
MMDetection Compiler: GCC 7.5
MMDetection CUDA Compiler: 10.1
**Error traceback**
File "/home/docker/web/utils/recognition.py", line 110, in getResult
model = init_detector(config_fname, checkpoint_file)
File "/home/docker/mmdetection/mmdet/apis/inference.py", line 33, in init_detector
model = build_detector(config.model, test_cfg=config.test_cfg)
File "/home/docker/mmdetection/mmdet/models/builder.py", line 48, in build_detector
return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/home/docker/mmdetection/mmdet/models/builder.py", line 20, in build
return build_from_cfg(cfg, registry, default_args)
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 168, in build_from_cfg
return obj_cls(**args)
TypeError: __init__() got an unexpected keyword argument 'bbox_roi_extractor'
```
Hey, I had faced the same error yesterday. You might have to upgrade mode version. Since the config file is not having the same structure.
Please try running:
python setup.py develop
It has been suggested in #1860
Hey, I had faced the same error yesterday. You might have to upgrade mode version. Since the config file is not having the same structure.
Please try running:
python setup.py develop
It has been suggested in #1860
I saw this issue. I cloned latest version of mmdetection and ran python setup.py develop in mmdetection directory. I can't get rid of the error.
Also docker file exists cloning latest version and installation. I don't get errors when I build docker, but I got this runtime error.
Should I retrain my neural network on a new version mmdetection if the configuration file structure has changed? My network was trained a few months ago. But when I use docker I always get the latest version of the library when building the container.
Do you mind giving the training command you used??
Earlier the mistake I was doing was that I was giving a config for GCNet from the GCNet repo instead of the mmdet repo. The versions are different. That's when I got exactly the same error as in w.r.t bb_roi_extractor being an unexpected keyword.
And I don't think retraining is required, instead you could change the old config file to the newer version's format and use the converted config for testing.
You need to modify the config files according to the new structure, and then upgrade your model following the documentation.
Thanks for your help! I used old config file. After updating config file, error disappeared.
I encountered similar problems because the project versions were different and some parameters had different names. The solution was to compare the config file with the old version and modify those new parameters.
Most helpful comment
You need to modify the config files according to the new structure, and then upgrade your model following the documentation.