You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2022-03-19 09:44:59,167 - mmdet - INFO - initialize ResNet with init_cfg {'type': 'Pretrained', 'checkpoint': 'torchvision://resnet50'}
2022-03-19 09:44:59,168 - mmcv - INFO - load model from: torchvision://resnet50
2022-03-19 09:44:59,168 - mmcv - INFO - load checkpoint from torchvision path: torchvision://resnet50
2022-03-19 09:44:59,410 - mmcv - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: fc.weight, fc.bias
2022-03-19 09:44:59,444 - mmdet - INFO - initialize FPN with init_cfg {'type': 'Xavier', 'layer': 'Conv2d', 'distribution': 'uniform'}
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
return obj_cls(**args)
File "/content/drive/MyDrive/Colab/r3det-pytorch-main/r3det/datasets/mydataset1.py", line 47, in init
super(MyDataset, self).init(ann_file, pipeline, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/custom.py", line 95, in init
self.data_infos = self.load_annotations(local_path)
File "/content/drive/MyDrive/Colab/r3det-pytorch-main/r3det/datasets/mydataset1.py", line 102, in load_annotations
label = cls_map[cls_name]
KeyError: 'ship'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./tools/train.py", line 193, in
main()
File "./tools/train.py", line 169, in main
datasets = [build_dataset(cfg.data.train)]
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/builder.py", line 81, in build_dataset
dataset = build_from_cfg(cfg, DATASETS, default_args)
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "MyDataset: 'ship'"
我仿照DOTA的配置文件写了一个MyDataset类,并只把
CLASSES = ('plane', 'baseball-diamond', 'bridge', 'ground-track-field', 'small-vehicle', 'large-vehicle', 'ship', 'tennis-court', 'basketball-court', 'storage-tank', 'soccer-ball-field', 'roundabout', 'harbor', 'swimming-pool', 'helicopter')
改为了:
CLASSES = 'ship'
以下为运行后自动生成的代码
2022-03-19 09:44:59,167 - mmdet - INFO - initialize ResNet with init_cfg {'type': 'Pretrained', 'checkpoint': 'torchvision://resnet50'}
2022-03-19 09:44:59,168 - mmcv - INFO - load model from: torchvision://resnet50
2022-03-19 09:44:59,168 - mmcv - INFO - load checkpoint from torchvision path: torchvision://resnet50
2022-03-19 09:44:59,410 - mmcv - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: fc.weight, fc.bias
2022-03-19 09:44:59,444 - mmdet - INFO - initialize FPN with init_cfg {'type': 'Xavier', 'layer': 'Conv2d', 'distribution': 'uniform'}
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
return obj_cls(**args)
File "/content/drive/MyDrive/Colab/r3det-pytorch-main/r3det/datasets/mydataset1.py", line 47, in init
super(MyDataset, self).init(ann_file, pipeline, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/custom.py", line 95, in init
self.data_infos = self.load_annotations(local_path)
File "/content/drive/MyDrive/Colab/r3det-pytorch-main/r3det/datasets/mydataset1.py", line 102, in load_annotations
label = cls_map[cls_name]
KeyError: 'ship'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./tools/train.py", line 193, in
main()
File "./tools/train.py", line 169, in main
datasets = [build_dataset(cfg.data.train)]
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/builder.py", line 81, in build_dataset
dataset = build_from_cfg(cfg, DATASETS, default_args)
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "MyDataset: 'ship'"
The text was updated successfully, but these errors were encountered: