yolov5_obb icon indicating copy to clipboard operation
yolov5_obb copied to clipboard

用dataset进行推理时,有如下报错,数据损坏?images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100%

Open Sooguo opened this issue 1 year ago • 11 comments

执行步骤: python3 val.py --data 'data/yolov5obb_demo_split.yaml' --weights './yolov5m_finetune/weights/best.pt' --batch-size 2 --img 1024 --task 'val' --device 0 --save-json --name 'obb_demo_split' 报错: val: data=data/yolov5obb_demo_split.yaml, weights=['./yolov5m_finetune/weights/best.pt'], batch_size=2, imgsz=1024, conf_thres=0.01, iou_thres=0.4, task=val, device=0, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=obb_demo_split, exist_ok=False, half=False, dnn=False YOLOv5 🚀 b00c3f2 torch 1.9.0a0+c3d40fd CUDA:0 (Tesla T4, 14966MiB)

Fusing layers... Model Summary: 290 layers, 21640929 parameters, 0 gradients, 50.4 GFLOPs val: Scanning 'dataset/dataset_demo_rate1.0_split1024_gap200/labelTxt.cache' images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<?, ?it/s]val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__0___0.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__0___665.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__1401___0.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__1401___665.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__824___0.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' val: WARNING: dataset/dataset_demo_rate1.0_split1024_gap200/images/P0032__1__824___665.png: ignoring corrupt image/label: 'dict' object has no attribute 'index' Traceback (most recent call last): File "val.py", line 401, in main(opt) File "val.py", line 374, in main run(**vars(opt)) File "/opt/conda/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "val.py", line 167, in run dataloader = create_dataloader(data[task], imgsz, batch_size, stride, names, single_cls, pad=pad, rect=pt, File "/home/ghguo/yolov5_obb/utils/datasets.py", line 101, in create_dataloader dataset = LoadImagesAndLabels(path, names, imgsz, batch_size, File "/home/ghguo/yolov5_obb/utils/datasets.py", line 444, in init labels, shapes, self.segments = zip(*cache.values()) ValueError: not enough values to unpack (expected 3, got 0) val: Scanning 'dataset/dataset_demo_rate1.0_split1024_gap200/labelTxt.cache' images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<?, ?it/s]

使用非splict的数据集也有类似的问题

Sooguo avatar May 26 '23 05:05 Sooguo

label.txt看起来很正常啊,为啥会判断corupted呢

Sooguo avatar May 26 '23 05:05 Sooguo

可以加下联系方式讨论下这个吗

hecheng000 avatar May 29 '23 12:05 hecheng000

有解决吗

oceanechy avatar Jun 26 '23 04:06 oceanechy

请问你win10下跑通训练了吗

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年06月26日 12:02 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [hukaixuan19970627/yolov5_obb] 用dataset进行推理时,有如下报错,数据损坏?images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100% (Issue #569) |

有解决吗

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

hecheng000 avatar Jul 08 '23 02:07 hecheng000

可以加下联系方式讨论一下吗,q508152494

goodfishboy avatar Aug 03 '23 12:08 goodfishboy

可以加下联系方式讨论一下吗,q508152494

搜不到你

hecheng000 avatar Aug 03 '23 12:08 hecheng000

不好意思,现在应该可以了,或者我加一下您  

2377823833 @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年8月3日(星期四) 晚上8:47 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [hukaixuan19970627/yolov5_obb] 用dataset进行推理时,有如下报错,数据损坏?images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100% (Issue #569)

可以加下联系方式讨论一下吗,q508152494

搜不到你

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

goodfishboy avatar Aug 03 '23 12:08 goodfishboy

或者加一下这个q:2377823833,这个微信:y2377823833,万分感谢  

2377823833 @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年8月3日(星期四) 晚上8:47 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [hukaixuan19970627/yolov5_obb] 用dataset进行推理时,有如下报错,数据损坏?images and labels... 6 found, 0 missing, 0 empty, 6 corrupted: 100% (Issue #569)

可以加下联系方式讨论一下吗,q508152494

搜不到你

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

goodfishboy avatar Aug 03 '23 12:08 goodfishboy

可以加下联系方式讨论一下吗,q508152494

搜不到你

现在可以了,万分感谢

goodfishboy avatar Aug 03 '23 12:08 goodfishboy

@Sooguo 请问有解决吗,我之前跑通过,现在每次运行都报这个错了

Loading-xxx avatar Nov 13 '23 01:11 Loading-xxx

在 utils/datasets.py 的第982行左右,把 cls_id = cls_name_list.index(label[8]) 修改为 cls_id = list(cls_name_list.values()).index(label[8]) 就行了

qqqtwh avatar Aug 16 '24 07:08 qqqtwh