wangchen1801 / FPD

Official code of the paper "Fine-Grained Prototypes Distillation for Few-Shot Object Detection (AAAI 2024)"
https://arxiv.org/pdf/2401.07629.pdf
28 stars 4 forks source link

Error about training about "use_meta_conv" #17

Open PiPiNam opened 1 month ago

PiPiNam commented 1 month ago

Thanks for your great work!

I wanna run your code to train a base model, However, I met some errors as below:

Errors

And here is my environment: env

wangchen1801 commented 1 month ago

This seems like a compatibility issue. Please make sure these versions are consistent:

mim install mmcv-full==1.6.0
mim install mmcls==0.25.0
mim install mmdet==2.24.0

Do not use mim to install mmfewshot

mim install mmfewshot  # bugs

Please let me know if the problem still exists.

PiPiNam commented 1 month ago

Thanks for your reply! The error still persists and I found out by analyzing the traceback

File "/mnt/data/linan/FPD/fpd/fpd_detector.py", line 102, in extract_support_feat feats = self.backbone(img, use_meta_conv=True)

I try to delete the use_meta_conv parameter and then get the error as below:

image

I found FPD's Backbone uses use_meta_conv variable, which jumps to the ResNet class in mmdet/models/backbones/resnet.py when I run the train.py. By looking at the forward method of this class, I found that it does not support the use_meta_conv=True parameter, so the above error was generated.

image

By analyzing the network structure of the FPD, it is found that the backbone should refer mmfewshot/detection/models/resnet_with_meta_conv.py instead of resnet.py that not supporting use_meta_conv parameter.

In the end, I was able to run successfully by replacing the forward fuction in resnet.py of mmdet with the forward function in resnet_with_meta_conv.py of mmfewshot that supports use_meta_conv parameters.

image

Although the code has been successfully run now, the problem has not been completely resolved, and I am looking forward to working with you to solve the problem!