当前位置:   article > 正文

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

filenotfounderror: train: no labels found in

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
	}
  • 1
  • 2
  • 3


解决方案:

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

要在环境当中修改!!
其中JPEGImages 要对应的修改为自己的数据文件夹中存放图片的子文件夹名称。具体如下图
在这里插入图片描述

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
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/618012
推荐阅读
相关标签
  

闽ICP备14008679号