yuantn/MI-AOD

Question about changing backbone

bluvory opened this issue · 13 comments

Hello, I have a question about changing the backbones.
I want to change the backbone retinanet to ssd.
( customize 3 just like you customized 1 to 2 according to the paper )

I tried customizing it, and the following error occurred. ( look at link4 )
TypeError: init() missing 1 required positional argument: 'input_size'

So when I deleted input_size, I got the following error.
NameError: name 'input_size' is not defined

model, train_cfg, test_cfg are well inputted.
How can I fix this?

  1. https://github.com/open-mmlab/mmdetection/blob/master/configs/_base_/models/retinanet_r50_fpn.py
  2. https://github.com/yuantn/MI-AOD/blob/master/configs/_base_/retinanet_r50_fpn.py
  3. https://github.com/open-mmlab/mmdetection/blob/master/configs/_base_/models/ssd300.py
  4. https://github.com/bluvory/kuaicv/blob/main/ssd_vgg_custom.py

Have you modified Line 4~7 in configs/MIAOD.py?

The './_base_/retinanet_r50_fpn.py' need to be replaced by your ssd_vgg_custom.py.

yes I already fixed that but error occurs.

What if you uncomment the Line 6 in link 4?

If i uncomment it, this error occurs.
TypeError: init() missing 1 required positional argument: 'input_size'

Can I have a look at your outermost configuration file (like configs/MIAOD.py instead of configs/_base_/models/ssd300.py )?

handRL is our custom dataset and this file (hand2voc) has been changed to voc format.

https://github.com/bluvory/kuaicv/blob/main/MIAOD.py
https://github.com/bluvory/kuaicv/blob/main/handRL.py

I think that maybe you should add or modify something in this SSD+VOC configuration file to your MIAOD.py, such as train_pipeline, test_pipeline, and so on.

You can refer to the difference between MIAOD.py and the RetinaNet+VOC configuration file.

I changed the MIAOD.py like this on your advice,
but the error continues because (maybe) the ssd_vgg_custom.py has not changed.
TypeError: init() missing 1 required positional argument: 'input_size'

It is really a confusing error... Could you provide your full output log?

here, I put both cases of errors in this link.
(input_size=300 is in ssd_vgg_custom.py)

https://github.com/bluvory/kuaicv/blob/main/error.py

I think I have got the point of the problem, that is, you need to add input_size=input_size in the model.backbone (anywhere in Lines 11-16) in your ssd_vgg_custom.py.

The deep reason is that, all of this MI-AOD repository is based on MMDetection V2.3.0 but not the latest version of MMDetection. There are some differences between these two versions. Please customize any files on the version 2.3.0.

I got it. Thank you for your kind response.
Have a nice day :)

@bluvory cna you please share ur implementation with retinanet repo