PyTorch_YOLOv4 icon indicating copy to clipboard operation
PyTorch_YOLOv4 copied to clipboard

运行时报错

Open hao211990 opened this issue 4 years ago • 3 comments

Traceback (most recent call last): File "train.py", line 438, in train(hyp, opt, device, tb_writer) File "train.py", line 147, in train world_size=opt.world_size) File "/home/f508/PyTorch_YOLOv4-master/utils/datasets.py", line 60, in create_dataloader pad=pad) File "/home/f508/PyTorch_YOLOv4-master/utils/datasets.py", line 345, in init labels, shapes = zip([cache[x] for x in self.label_files]) File "/home/f508/PyTorch_YOLOv4-master/utils/datasets.py", line 345, in labels, shapes = zip([cache[x] for x in self.label_files]) KeyError: 'data/coco/labels/train2017/1.txt' 在windows上运行的时候没有错误,换到u下就报这错 大佬这时什么原因啊

hao211990 avatar Jan 11 '21 15:01 hao211990

把資料集裡的.cache檔砍掉再跑一次

WongKinYiu avatar Jan 13 '21 05:01 WongKinYiu

I tried clearing out the cache files but still have the same problem and here is the output: Scanning images: 100% 6183/6183 [46:08<00:00, 2.23it/s] Traceback (most recent call last): File "train.py", line 438, in train(hyp, opt, device, tb_writer) File "train.py", line 147, in train world_size=opt.world_size) File "/content/drive/MyDrive/PyTorch_YOLOv4/utils/datasets.py", line 60, in create_dataloader pad=pad) File "/content/drive/MyDrive/PyTorch_YOLOv4/utils/datasets.py", line 344, in init labels, shapes = zip(*[cache[x] for x in self.img_files]) TypeError: zip argument #633 must support iteration

alien19 avatar Jan 17 '21 13:01 alien19

查看yaml文件中是不是有images,会替换成labels,只要换个文件夹名字就行

cyyhundred avatar Mar 13 '23 11:03 cyyhundred