SSD就不多介绍了,是今年非常流行的Object detection 模型:对各大数据集的测试结果如下表。
首先要git weiliu版本的caffe
git clone https://github.com/weiliu89/caffe.git
然后在unbantu上对caffe进行配置,百度一下教程
# Modify Makefile.config according to your Caffe installation. cp Makefile.config.example Makefile.config make -j8 # Make sure to include $CAFFE_ROOT/python to your PYTHONPATH. make py make test -j8 # (Optional) make runtest -j8
首先要准备VGG16 的模型without fc layer 的版本,下载地址:https://gist.github.com/weiliu89/2ed6e13bfd5b57cf81d6
下载后放在caffe/model/VGGNet中,在训练的时候,会fine turn这个VGG模型
然后下载一下VOC数据集等:
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
接下来创建LMDB的files,用shell指令: tips: ./之前为caffe_root的根路径,可以在配置完环境变量后,直接用$CAFFE_ROOT代替
cd $CAFFE_ROOT # Create the trainval.txt, test.txt, and test_name_size.txt in data/VOC0712/ ./data/VOC0712/create_list.sh # You can modify the parameters in create_data.sh if needed. # It will create lmdb files for trainval and test with encoded original image: # - $HOME/data/VOCdevkit/VOC0712/lmdb/VOC0712_trainval_lmdb # - $HOME/data/VOCdevkit/VOC0712/lmdb/VOC0712_test_lmdb # and make soft links at examples/VOC0712/ ./data/VOC0712/create_data.sh
然后进到caffe根目录运行:
python examples/ssd/ssd_pascal.py
四卡的机器,训练过程如下:
接下来测试一下accuracy,运行速度等
原文地址:https://www.cnblogs.com/ChrisInsistPy/p/9609894.html
时间: 2024-11-03 01:19:10