https://qiita.com/enya314/items/1bd053d6a81a156ff814
このサイトに従ってデータを用意し、googlecolabで学習をしていたのですが、train.pyを実行したところで
Traceback (most recent call last):
File "train.py", line 642, in <module>
main(opt)
File "train.py", line 538, in main
train(opt.hyp, opt, device, callbacks)
File "train.py", line 131, in train
model = Model(cfg, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create
File "/content/yolov5/models/yolo.py", line 92, in init
with open(cfg, encoding='ascii', errors='ignore') as f:
FileNotFoundError: [Errno 2] No such file or directory: '
とエラーが出てしまいます。
該当のソースコード
!git clone https://github.com/ultralytics/yolov5 !pip install -r yolov5/requirements.txt !pip install wandb %cd /content/yolov5 from google.colab import drive drive.mount('/content/drive') !python train.py --imgsz 640 --batch 8 --epochs 300 --data '/content/drive/MyDrive/drink_kind_7/dataset.yaml' --project '/content/drive/MyDrive/drink_kind_7/train' --name drink_kind_7 --weights yolov5s
エラーメッセージ
wandb: Currently logged in as: xxxx (use `wandb login --relogin` to force relogin) train: weights=yolov5s, cfg=, data=/content/drive/MyDrive/drink_kind_7/dataset.yaml, hyp=data/hyps/hyp.scratch.yaml, epochs=300, batch_size=8, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=/content/drive/MyDrive/drink_kind_7/train, name=drink_kind_7, exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest Traceback (most recent call last): File "train.py", line 642, in <module> main(opt) File "train.py", line 538, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 131, in train model = Model(cfg, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/content/yolov5/models/yolo.py", line 92, in __init__ with open(cfg, encoding='ascii', errors='ignore') as f: FileNotFoundError: [Errno 2] No such file or directory: '' wandb: Waiting for W&B process to finish, PID 1260... (failed 1). Press ctrl-c to abort syncing.
ディレクトリの構造は参考サイトと同様です。
一度実行した後のディレクトリなので、学習を保存するdrink_kind_7が新たに生成されているみたいです。
どう対処すれば良いか教えて下さると助かります。ご協力お願いします。
あなたの回答
tips
プレビュー