Open LLsmile opened 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
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
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.