YOLOV8:FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytic

YOLOV8:FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytic

问题描述

yolov8FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytic/…/JPEGImages.cache:

raise FileNotFoundError(f'{self.prefix}No labels found in {cache_path}, can not start training. {HELP_URL}')
FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytics-main/data/VOCdevkit/VOC2007/JPEGImages.cache, can not start training. See https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data
	}


解决方案:

在/home/smy/anaconda3/envs/yolo/lib/python3.9/site-packages/ultralytics-8.0.51-py3.9.egg/ultralytics/yolo/data/utils.py中修改下列代码

要在环境当中修改!!
其中JPEGImages 要对应的修改为自己的数据文件夹中存放图片的子文件夹名称。具体如下图
YOLOV8:FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytic_第1张图片

def img2label_paths(img_paths):
    # Define label paths as a function of image paths
    sa, sb = f'{os.sep}JPEGImages{os.sep}', f'{os.sep}labels{os.sep}'  # /images/, /labels/ substrings
    # sa, sb = f'{os.sep}images{os.sep}', f'{os.sep}labels{os.sep}'  # /images/, /labels/ substrings

你可能感兴趣的:(python,深度学习,目标检测)