作者:木凌
时间:2016年11月。
博客连接:http://blog.csdn.net/u014540717
前段时间在看YOLO的源代码,后来发现YOLOv2更新了,但官网还没给训练方法,就顺便写个YOLOv2的训练方法
其实跟之前的方法一模一样,就是命令换了而已,.txt文档生成方法就不介绍了,网上一大堆~
1 修改./cfg/voc.data文件
classes= 20
//修改为你训练数据的.txt目录
train = /home/pjreddie/data/voc/train.txt
//修改为你验证数据的.txt目录
valid = /home/pjreddie/data/voc/2007_test.txt
names = data/voc.names
//修改为你的模型备份目录
backup = /home/pjreddie/backup/
2 开始训练
这里我选择的是22层的网络,batch_size=64,subdivisions=8,如果你的内存太小,运行出错的话,可以把这两个值改小一点,然后运行以下指令即可开始训练
./darknet detector train ./cfg/voc.data ./cfg/yolo-voc.cfg
log如下
nohup: ignoring input
2 layer filters size input output
3 0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32
4 1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32
5 2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64
6 3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64
7 4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128
8 5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x