csuhan / ReDet

Official code of the paper "ReDet: A Rotation-Equivariant Detector for Aerial Object Detection" (CVPR 2021)
https://redet.csuhan.com
Apache License 2.0
394 stars 77 forks source link

AssertionError: annotation file format <class 'list'> not supported #62

Closed Sairam13001 closed 3 years ago

Sairam13001 commented 3 years ago

Hai! Could someone please tell me how to solve this error. I am trying to train ReDet on HRSC2016 dataset. This is the error I am getting.

ReResNet Orientation: 8 Fix Params: False 2021-08-04 14:12:24,505 - INFO - Distributed training: False 2021-08-04 14:13:14,962 - INFO - load model from: work_dirs/ReResNet_pretrain/re_resnet50_c8_batch256-25b16846.pth 2021-08-04 14:13:14,989 - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: head.fc.weight, head.fc.bias

missing keys in source state_dict: layer3.5.conv3.filter, layer4.2.conv3.filter, layer4.2.conv1.filter, layer2.3.conv2.filter, layer1.1.conv3.filter, layer4.1.conv3.filter, layer3.2.conv1.filter, layer2.1.conv2.filter, layer3.4.conv1.filter, layer3.3.conv2.filter, layer1.0.conv2.filter, layer1.2.conv3.filter, layer2.0.downsample.0.filter, layer3.0.conv1.filter, layer3.0.conv2.filter, layer3.1.conv3.filter, layer2.2.conv2.filter, layer3.4.conv2.filter, layer4.0.conv1.filter, layer2.2.conv3.filter, layer1.0.downsample.0.filter, layer4.0.conv3.filter, layer4.2.conv2.filter, layer2.0.conv3.filter, layer3.2.conv2.filter, layer3.3.conv3.filter, layer4.0.conv2.filter, layer3.4.conv3.filter, layer4.1.conv2.filter, layer3.1.conv1.filter, layer2.1.conv3.filter, layer2.1.conv1.filter, layer1.0.conv1.filter, layer2.0.conv2.filter, layer1.1.conv1.filter, layer1.2.conv2.filter, layer2.3.conv3.filter, layer4.0.downsample.0.filter, layer3.5.conv2.filter, layer3.5.conv1.filter, layer2.3.conv1.filter, layer2.0.conv1.filter, conv1.filter, layer1.0.conv3.filter, layer1.1.conv2.filter, layer3.0.downsample.0.filter, layer3.0.conv3.filter, layer4.1.conv1.filter, layer1.2.conv1.filter, layer3.2.conv3.filter, layer3.3.conv1.filter, layer3.1.conv2.filter, layer2.2.conv1.filter

loading annotations into memory... Traceback (most recent call last): File "tools/train.py", line 95, in main() File "tools/train.py", line 75, in main train_dataset = get_dataset(cfg.data.train) File "/home/ai20resch13001/ReDet/mmdet/datasets/utils.py", line 109, in get_dataset dset = obj_from_dict(data_info, datasets) File "/DATA/ai20resch13001/anaconda3/envs/redet2/lib/python3.7/site-packages/mmcv/runner/utils.py", line 78, in obj_from_dict return obj_type(**args) File "/home/ai20resch13001/ReDet/mmdet/datasets/custom.py", line 68, in init self.img_infos = self.load_annotations(ann_file) File "/home/ai20resch13001/ReDet/mmdet/datasets/coco.py", line 25, in load_annotations self.coco = COCO(ann_file) File "/DATA/ai20resch13001/anaconda3/envs/redet2/lib/python3.7/site-packages/pycocotools/coco.py", line 86, in init assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset)) AssertionError: annotation file format <class 'list'> not supported

heizie commented 3 years ago

you should first transform your HRSC2016 to coco format

Sairam13001 commented 3 years ago

Yeah, I used HRSC2DOTA and HRSC2JSON from here to do that. Please tell me if it is not sufficient?

Sairam13001 commented 3 years ago

you should first transform your HRSC2016 to coco format

Or, could you please tell me how to convert HRSC2016 to coco format

csuhan commented 3 years ago

Please use https://github.com/csuhan/s2anet/blob/original_version/DOTA_devkit/HRSC2DOTA.py and then https://github.com/csuhan/ReDet/blob/master/DOTA_devkit/HRSC2COCO.py

See our https://github.com/csuhan/ReDet/blob/master/GETTING_STARTED.md

Sairam13001 commented 3 years ago

Thank you. Got it