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中修改下列代码文章来源:https://www.toymoban.com/news/detail-623084.html
要在环境当中修改!!
其中JPEGImages
要对应的修改为自己的数据文件夹中存放图片的子文件夹名称。具体如下图
文章来源地址https://www.toymoban.com/news/detail-623084.html
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
到了这里,关于YOLOV8:FileNotFoundError: train: No labels found in /home/smy/new-yolov5/ultralytic的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!