首页
登录 | 注册

目标检测RON网络VOC2007训练测试

源码github

1.RON320 VOC07_test

下载VOC2007数据集,其解压放到RON/data目录下,修改文件夹名VOCdevkit为VOCdevkit2007(与代码中一致)

前提已经下载好模型RON320_VOC0712_VOC07.caffemodel(参照)

在VOCdevkit2007中创建系列文件夹 ./results/VOC2007/Main,否则运行test会报错找不到VOCdevkit2007/results/VOC2007/Main…文件

在RON目录下运行脚本./test_voc07.sh
得到测试结果如下,MAP为0.742

Saving cached annotations to data/VOCdevkit2007/annotations_cache/annots.pkl 
AP for aeroplane = 0.7638 
AP for bicycle = 0.7953 
AP for bird = 0.7472 
AP for boat = 0.6666 
AP for bottle = 0.5295 
AP for bus = 0.8348 
AP for car = 0.8339 
AP for cat = 0.8582 
AP for chair = 0.5569 
AP for cow = 0.7916 
AP for diningtable = 0.6942 
AP for dog = 0.8427 
AP for horse = 0.8134 
AP for motorbike = 0.8322 
AP for person = 0.7609 
AP for pottedplant = 0.4906 
AP for sheep = 0.7362 
AP for sofa = 0.7551 
AP for train = 0.8030 
AP for tvmonitor = 0.7241 
Mean AP = 0.7415 

2.RON320 VOC07_train

我是在一路titan显卡上训练

下载预训练模型VGG_ILSVRC_16_layers_fc_reduced.caffemodel,放到data/ImageNet_models,修改脚本train_voc.sh并运行

python tools/train_net.py --gpu 0 \
  --solver models/pascalvoc/VGG16/solver.prototxt \
  #  只训练VOC2007,默认的--imdb参数就是
  --weights data/ImageNet_models/VGG16_layers_fully_conv.caffemodel \
  --batchsize 16 \#batchsize 20过大,会cuda out of memory
  --iters 10000

注:若出现cudnn报错,因为编译没加cudnn,因此我把prototxt中engine: CUDNN全去掉

注:若output文件夹没有权限,先给其权限

因为时间问题,这儿我是仅训练voc2007,迭代10000次,batchsize为16,训练了7小时,训练结果得到 loss=1.195

测试map,运行命令

python ./tools/test_net.py --gpu 0 \
  --def models/pascalvoc/VGG16/test320cudnn.prototxt \
  --net output/default/voc_2007_trainval/RON_320_iter_10000.caffemodel \
  --imdb voc_2007_test

结果为 map=0.61,达到作者效果的82%。时间充足可以尝试按照官方给的迭代120000次,batchsize为20,VOC2007+2012训练

AP for aeroplane = 0.6431 
AP for bicycle = 0.7331 
AP for bird = 0.5981 
AP for boat = 0.4798 
AP for bottle = 0.3230 
AP for bus = 0.6838 
AP for car = 0.7294 
AP for cat = 0.7936 
AP for chair = 0.3810 
AP for cow = 0.6029 
AP for diningtable = 0.4608 
AP for dog = 0.6924 
AP for horse = 0.7696 
AP for motorbike = 0.6863 
AP for person = 0.6396 
AP for pottedplant = 0.3565 
AP for sheep = 0.5833 
AP for sofa = 0.6703 
AP for train = 0.7615 
AP for tvmonitor = 0.6178 
Mean AP = 0.6103 


2020 jeepxie.net webmaster#jeepxie.net
10 q. 0.008 s.
京ICP备10005923号