zcablii / SARDet_100K

Offical implementation of MSFA and release of SARDet_100K dataset for Large-Scale Synthetic Aperture Radar (SAR) Object Detection
Other
328 stars 25 forks source link

MSFA is not in the mmdet::model registry error #29

Closed MichaelD7911 closed 2 weeks ago

MichaelD7911 commented 1 month ago

I was trying to run an inference and got an error:

Code:

from mmdet.apis import DetInferencer

config_file = 'local_configs/SARDet/r50_IN_sup/fg_frcnn_IN_sup_sar_r50.py'
checkpoint_file = 'work_dirs/fg_frcnn_IN_sup_sar_r50/best_coco_bbox_mAP_epoch_12.pth'

inferencer = DetInferencer(model=config_file, weights=checkpoint_file)

Error:

KeyError: 'MSFA is not in the mmdet::model registry. 
Please check whether the value of `MSFA` is correct or it was registered as expected.
 More details can be found at 
https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'

What is a fix for this or it is more related to MMDetection framework ?

zcablii commented 4 weeks ago

Normally, it can be solved by running python setup.py install. If it still not working, please try to reinstall the environment according to the readme step by step.

MichaelD7911 commented 3 weeks ago

Thank you @zcablii, I've tried python setup.py install it didn't help. Before that, I've installed step by step following readme file.

The train and test procedure are working without errors.

zcablii commented 2 weeks ago

You may also need to import msfa like:

import msfa
from mmdet.apis import DetInferencer

config_file = 'local_configs/SARDet/r50_IN_sup/fg_frcnn_IN_sup_sar_r50.py'
checkpoint_file = 'work_dirs/fg_frcnn_IN_sup_sar_r50/best_coco_bbox_mAP_epoch_12.pth'

inferencer = DetInferencer(model=config_file, weights=checkpoint_file)
MichaelD7911 commented 2 weeks ago

Yes, import msfa solves it.

Thank you!