tinyvision / DAMO-YOLO

DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.
Apache License 2.0
3.77k stars 473 forks source link

运行出现bug 这么解决 #133

Open sharp-xiang opened 8 months ago

sharp-xiang commented 8 months ago

Before Asking

Search before asking

Question

[Bug]: TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/data/Disk_B/minrui/anaconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/data/Disk_B/minrui/anaconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/data/Disk_B/minrui/anaconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/data/Disk_B/minrui/DAMO-YOLO-master/damo/dataset/datasets/mosaic_wrapper.py", line 226, in getitem img, labels, segments, img_id = self._dataset.pull_item(idx) File "/data/Disk_B/minrui/DAMO-YOLO-master/damo/dataset/datasets/coco.py", line 97, in pull_item obj_mask += mask TypeError: 'int' object is not iterable

Additional

image

ksv87 commented 6 months ago

make sure that the files are instances_train 2017.json and instances_val2017.json segmentation tags are set to [] (not int) or fix the code here: https://github.com/tinyvision/DAMO-YOLO/blob/319572eef367340267ab6ab8ae253527a71d7c3a/damo/dataset/datasets/coco.py#L92-L103

image