Closed Aayush-Jain01 closed 2 years ago
Hi, you need to train the model on the COCO at first with the command like "./tools/dist_train.sh configs/GRCNN/mask_rcnn_grcnn109_fpn_2x_coco.py 8", as "checkpoint_params_grcnn109.pt" is a ImageNet pretrained model and it cannot be tested directly. During training, you could observe the performance on the validation set, which will be close to the result on the test set.
Note that the detection experiments reported in the paper are based on the repositories of the original detection papers, and it is bother to clean and release different codebases. Thus, we re-implement GRCNN on MMdetection, so that you can train GRCNN with different object detection methods and observe the results on the validation set. But we did not further implement the test script, so there could be errors in it :(
Thanks for the prompt reply. I tried training first but I still get the same error
python tools/train.py configs/GRCNN/mask_rcnn_grcnn109_fpn_2x_coco.py
Error
/mmdetection/mmdet/models/detectors/two_stage.py:29: UserWarning: DeprecationWarning: pretrained is deprecated, please use "init_cfg" instead
warnings.warn('DeprecationWarning: pretrained is deprecated, '
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
return obj_cls(**args)
File "/mmdetection/mmdet/models/detectors/mask_rcnn.py", line 27, in __init__
init_cfg=init_cfg)
File "/mmdetection/mmdet/models/detectors/two_stage.py", line 32, in __init__
self.backbone = build_backbone(backbone)
File "/mmdetection/mmdet/models/builder.py", line 20, in build_backbone
return BACKBONES.build(cfg)
File "/opt/conda/lib/python3.7/site-packages/mmcv/utils/registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "/opt/conda/lib/python3.7/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/opt/conda/lib/python3.7/site-packages/mmcv/utils/registry.py", line 45, in build_from_cfg
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'GRCNN is not in the models registry'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 188, in <module>
main()
File "tools/train.py", line 161, in main
test_cfg=cfg.get('test_cfg'))
File "/mmdetection/mmdet/models/builder.py", line 59, in build_detector
cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/opt/conda/lib/python3.7/site-packages/mmcv/utils/registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "/opt/conda/lib/python3.7/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/opt/conda/lib/python3.7/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.__name__}: {e}')
KeyError: "MaskRCNN: 'GRCNN is not in the models registry'"
Hi, could you please try with this command:
"./tools/dist_train.sh configs/GRCNN/mask_rcnn_grcnn109_fpn_2x_coco.py 8"
and show me the error as well ? (if you could use multiple GPUs)
Please give me some time to figure out the problem, as it has been long time since I finished this project.
Hi! Unfortunately I don't have access to multiple GPU's currently.
Sure, meanwhile if possible I'll try to get access to the GPU's and test the script on it. For some reason it is not able to register GRCNN to the model's registry. I am not aware of any script/command to be executed specifically for that, if so it would be really helpful if you could update the ReadMe with it.
tbh, I did not meet this problem before. Please also check the issues from the original mmdetection repository (since I found many users have the similar situation), such as:
https://github.com/open-mmlab/mmdetection/issues/5974
it could be related to the environment as well.
I will get back to you when I find the problem. Thx.
Hi, I think the problem could be solved, and the issue is from the version of mmdet and mmcv. A new file called "GRCNN_Detect.yaml" has been uploaded to the directory "./mmdetection", and I also update the information in README.md. If the problem still exists, please let me know.
Thanks ! This solved the problem
Objective
My objective is to test mask_rcnn_grcnn on COCO dataset. Please advise me the correct sequence of commands to do so
Issue
GRCNN model not registered as model in model registry
Background
pwd
Now, on executing
I am getting the following error
I can see that in
mmdet/models/backbones/GRCNN.py
@BACKBONES.register_module() is called but I am not sure how to execute GRCNN.py so that it gets registered as a model.My directory structure looks like