PyTorch_YOLOv4 icon indicating copy to clipboard operation
PyTorch_YOLOv4 copied to clipboard

AssertionError: File not found coco\val2017.txt.

Open harrykeepstudy opened this issue 5 years ago • 9 comments

I download the hold package from PyTorch_YOLOv4. I had done [pip install -r requirements.txt], and there wasn't any error. Then I try [python test_half.py --data coco2017.data --cfg yolov4-pacsp.cfg --weights yolov4-pacsp.pt --img 736 --iou-thr 0.7 --batch-size 8], but it pop out an error: [AssertionError: File not found coco\val2017.txt. See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data]. Which and where should I going to download or how to fix the problem? Thank you very much.

harrykeepstudy avatar Jul 20 '20 16:07 harrykeepstudy

https://github.com/WongKinYiu/PyTorch_YOLOv4/blob/master/data/get_coco2017.sh

WongKinYiu avatar Jul 21 '20 00:07 WongKinYiu

Thank very much for answering my question. I had been tried several times, but still have an error. I'm just download your github code, and download the data from get_coco2017.sh. After downloaded, I typed test_half.py in cmd.

Traceback (most recent call last): File "test_half.py", line 257, in opt.augment) File "test_half.py", line 64, in test dataset = LoadImagesAndLabels(path, img_size, batch_size, rect=True, single_cls=opt.single_cls) File "D:\PyTorch_YOLOv4-master_Wo\utils\datasets.py", line 262, in init assert os.path.isfile(path), 'File not found %s. See %s' % (path, help_url) AssertionError: File not found ..\coco\val2017.txt. See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data

harrykeepstudy avatar Jul 24 '20 01:07 harrykeepstudy

where is your coco path?

WongKinYiu avatar Jul 24 '20 01:07 WongKinYiu

My coco path is [ PyTorch_YOLOv4-master\data\coco ]. Inside this coco file is coco2017labels.zip unzip data.

harrykeepstudy avatar Jul 24 '20 01:07 harrykeepstudy

so you should modify path in your .data file from ../coco/ to ./data/coco/

WongKinYiu avatar Jul 24 '20 01:07 WongKinYiu

I just try to put val2017.txt under the file PyTorch_YOLOv4-master, this time the error is [ No such file or directory: '.\images\val2017\000000182611.jpg' ]. Because I working on windows system, I can write some simple codes to set the path for feeding the .jpg. Thank you very much for helping me.

harrykeepstudy avatar Jul 24 '20 01:07 harrykeepstudy

also change the path to correct path in your val2017.txt

WongKinYiu avatar Jul 24 '20 01:07 WongKinYiu

Thank you for reminding.

harrykeepstudy avatar Jul 24 '20 01:07 harrykeepstudy

The get_coco2017.sh didnt work for me, I am trying to use the .txt annotations from steps https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh

interactivetech avatar Jan 10 '24 18:01 interactivetech