您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页Win10 + YOLOv3训练VOC数据集-----How to train Pascal VOC Data

Win10 + YOLOv3训练VOC数据集-----How to train Pascal VOC Data

来源:化拓教育网

  How to train (Pascal VOC Data):

               

 

  1. 2.1 Download file voc_label.py to dir build\darknet\x\data\voc

  2. Download and install Python for Windows: 

  3. Run command: python build\darknet\x\data\voc\voc_label.py (to generate files: 2007_test.txt, 2007_train.txt, 2007_val.txt, 2012_train.txt, 2012_val.txt)

 

    (cmd下进入H:\YOLOV3\darknet-master\build\darknet\x\data\voc  运行命令python voc_label.py,之后就会生成下面几个文件)

 

              

 

 

  1. Run command: type 2007_train.txt 2007_val.txt 2012_*.txt > train.txt

    命令的作用就是将四个txt文件合并成一个txt文件(2007_test.txt 训练时不使用) ,所以会生成一个新的 train.txt 文件,文件大小就是前面四个文件的和。

    

 

  1. Set batch= and subdivisions=8 in the file yolov3-voc.cfg

    文件位置:H:\YOLOV3\darknet-master\cfg

  1. Start training by using train_voc.cmd or by using the command line:

    darknet.exe detector train data/voc.data cfg/yolov3-voc.cfg darknet53.conv.74

    我的train_voc.cmd 文件中的代码不是上面这一行,运行会提示找不到 darknet19_48.conv.23。我将原来的代码注释掉了,添加了上面上面这一行代码。

    

    之后双击运行 train_voc.cmd 文件,运行2秒闪退,提示:CUDA Error:out of memory 

    参考:https:///dcrmg/article/details/78565350 修改如下:

    1.GPU=1  CUDNN=1 修改之前都是 0 。

 

    

    根据训练时需要执行的语句:darknet.exe detector train data/voc.data cfg/yolov3-voc.cfg darknet53.conv.74

    voc.datayolov3-voc.cfg 分别修改成如下:

    (如果不修改,或者按照修改成其他文件时会提示:could not open file:darknet19_48.conv.23 或者提示错误: CUDA Error:out of memory )

    

    

    修改好后,双击运行train_voc.cmd文件,就开始训练了。

    截图纪念如下:

    

 

 

    

 

 

 

(Note: To disable Loss-Window use flag -dont_show. If you are using CPU, try darknet_no_gpu.exe instead of darknet.exe.)

If required change pathes in the file build\darknet\x\data\voc.data

More information about training by the link: 

Note: If during training you see nan values for avg (loss) field - then training goes wrong, but if nan is in some other lines - then training goes well.

转载于:https://www.cnblogs.com/yangzhaonan/p/9497887.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务