昨天我想在 google colab 中训练 yolov7,我将部分数据上传到 google drive,然后我将 colab 访问我的驱动器。训练进行得很顺利。今天我将完整的数据集上传到谷歌驱动器我得到
Exception: Dataset not found.
这是代码
from google.colab import drive
drive.mount('/content/drive')
%cd r'drive/MyDrive/yolov7/'
!python train.py --workers 1 --device 0 --batch-size 8 --epochs 40 --img 640 640 --hyp data/hyp.scratch.custom.yaml --name yolov7-custom --weights yolov7-tiny.pt --data data.yaml
这里是 data.yaml 文件
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
train: /data/train
val: /data/val
# number of classes
nc: 1
# class names
names: [ 'face']
这是错误
Transferred 332/338 items from yolov7-tiny.pt
WARNING: Dataset not found, nonexistent paths: ['/content/drive/MyDrive/yolov7/val']
Traceback (most recent call last):
File "/content/drive/MyDrive/yolov7/train.py", line 616, in <module>
train(hyp, opt, device, tb_writer)
File "/content/drive/MyDrive/yolov7/train.py", line 97, in train
check_dataset(data_dict) # check
File "/content/drive/MyDrive/yolov7/utils/general.py", line 173, in check_dataset
raise Exception('Dataset not found.')
Exception: Dataset not found.
我刚刚将其余数据集上传到与以前相同的目录,但现在模型找不到数据集。当我再次检查文件的路径时,
drive/MyDrive/yolov7/data
任何人都可以帮助我解决这个问题吗?