火车自定义检测器yolov4-roboflow-pytorch.ipynb的问题

发布于 2025-01-30 06:33:06 字数 1475 浏览 5 评论 0原文

I was trying the yoloV4 pytorch model from the https://models.roboflow.com/object -Detection/Yolov4-Pytorch 我看了教程和评论部分,但仍无法正常工作。

这是

%cd ..
#start training
#-b batch size (you should keep this low (2-4) for training to work properly)
#-s number of subdivisions in the batch, this was more relevant for the darknet framework
#-l learning rate
#-g direct training to the GPU device
#pretrained invoke the pretrained weights that we downloaded above
#classes - number of classes
#dir - where the training data is
#epoch - how long to train for
!python ./pytorch-YOLOv4/train.py -b 2 -s 1 -l 0.001 -g 0 -pretrained /content/pytorch-YOLOv4/cfg/yolov4.conv.137.pth -classes {num_classes} -dir ./train -epochs 50

第一个错误是目录不可避免,因此我更改了目录,但是现在这是它显示的错误:

log file path:log/log_2022-05-19_08-01-18.txt
2022-05-19 08:01:18,220 train.py[line:435] INFO: Using device cuda
Traceback (most recent call last):
  File "./pytorch-YOLOv4/train.py", line 447, in <module>
    device=device, )
  File "./pytorch-YOLOv4/train.py", line 247, in train
    train_dataset = Yolo_dataset(config.train_label, config)
  File "/content/pytorch-YOLOv4/dataset.py", line 254, in __init__
    f = open(lable_path, 'r', encoding='utf-8')
FileNotFoundError: [Errno 2] No such file or directory: 'train.txt'

我需要此问题的帮助,因为我不知道下一步该怎么做。

I was trying the yoloV4 pytorch model from the https://models.roboflow.com/object-detection/yolov4-pytorch I watched the tutorials and the comment section but it is still not working properly.

This is the code

%cd ..
#start training
#-b batch size (you should keep this low (2-4) for training to work properly)
#-s number of subdivisions in the batch, this was more relevant for the darknet framework
#-l learning rate
#-g direct training to the GPU device
#pretrained invoke the pretrained weights that we downloaded above
#classes - number of classes
#dir - where the training data is
#epoch - how long to train for
!python ./pytorch-YOLOv4/train.py -b 2 -s 1 -l 0.001 -g 0 -pretrained /content/pytorch-YOLOv4/cfg/yolov4.conv.137.pth -classes {num_classes} -dir ./train -epochs 50

The first error was that the directory was not avaiable and thus I changed the directory but now this is the error it is showing:

log file path:log/log_2022-05-19_08-01-18.txt
2022-05-19 08:01:18,220 train.py[line:435] INFO: Using device cuda
Traceback (most recent call last):
  File "./pytorch-YOLOv4/train.py", line 447, in <module>
    device=device, )
  File "./pytorch-YOLOv4/train.py", line 247, in train
    train_dataset = Yolo_dataset(config.train_label, config)
  File "/content/pytorch-YOLOv4/dataset.py", line 254, in __init__
    f = open(lable_path, 'r', encoding='utf-8')
FileNotFoundError: [Errno 2] No such file or directory: 'train.txt'

I need help with this problem as I have no idea what to do next.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文