python 未找到数据集..缺少路径..使用yolo v8训练模型时

qjp7pelc  于 2023-01-29  发布在  Python
关注(0)|答案(1)|浏览(784)

代码单元-

from ultralytics import YOLO
    model = YOLO("yolov8n.pt")
    results =  model.train(data="/workspace/awadh/nvidia/apis_mellifera/v8/datasets/Apis_mellifera_IIT_front_view-1/data.yaml", epochs=200, batch=16, imgsz=640)

显示错误-

/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/utils.py in check_dataset_yaml(dataset, autodownload)
    232                 LOGGER.warning(msg)
    233             else:
--> 234                 raise FileNotFoundError(msg)
    235             t = time.time()
    236             if s.startswith('http') and s.endswith('.zip'):  # URL

FileNotFoundError: 
Dataset '/workspace/awadh/nvidia/apis_mellifera/v8/datasets/Apis_mellifera_IIT_front_view-1/data.yaml' not found ⚠️, missing paths ['/workspace/awadh/nvidia/Species_detection/Apis_Mellifera/y8/datasets/Apis_mellifera_IIT_front_view-1/valid/images']

所以,同样的代码行在google colab中工作,但当我使用jupyter时,它不工作。数据集存在于文件位置,但这个错误还是出现了。

5ssjco0h

5ssjco0h1#

根据官方的python用法来源,版本8. 0. 20:

from ultralytics.yolo.engine.model import YOLO

model = YOLO("/path/to/your/model.pt")
results = model.predict(stream=True, source='ultralytics/ultralytics/assets', save=True) # source already setup

相关问题