OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.49k stars 232 forks source link

Evaluation failed #71

Open LLsmile opened 1 year ago

LLsmile commented 1 year ago

I trained a detection model with mask_rcnn_internimage_b_fpn_1x_coco.py. The training procedure goes well but evaluation crashed with following error: File "/home/liaolin/anaconda3/envs/internimage/lib/python3.9/site-packages/mmdet/models/detectors/base.py", line 174, in forward return self.forward_test(img, img_metas, **kwargs) File "/home/liaolin/anaconda3/envs/internimage/lib/python3.9/site-packages/mmdet/models/detectors/base.py", line 137, in forward_test img_meta[img_id]['batch_input_shape'] = tuple(img.size()[-2:]) TypeError: 'DataContainer' object is not subscriptable And the epoch_1.pth works well. So I have to change evaluation interval to the max epoch to avoid evaluation. But it seems weird.

LLsmile commented 1 year ago

Here is my datasets. One image is enough to reproduce the error.

jeonga0303 commented 1 year ago

I had a similar experience. Which torch version are you using? torch, torchvision, and mmcv version are important I used torch 1.12.0 so I used 1.7.0 for the mmcv version. That error disappeared when I did this. I was good at 1epoch, but I got an error in eval mode

Go to this site, select your own cuda version and torch version, and match the mmcv version

image

https://mmcv.readthedocs.io/en/latest/get_started/installation.html

mim uninstall mmcv-full pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.12/index.html

try this solution