Fast Region-based Convolutional Networks for object detection
根据上面这个网址开始配置,本次博客的主要目的是介绍有哪些坎。
Installation (sufficient for the demo)
1. Clone the Faster R-CNN repository
# Make sure to clone with --recursive
git clone --recursive https://github.com/smallcorgi/Faster-RCNN_TF.git
克隆下来的是一个文件夹,faster-rcnn-master2,如果你git clone失败的话直接复制https://github.com/smallcorgi/Faster-RCNN_TF.git,然后使用浏览器下载吧。
2.
cd tf-faster-rcnn/lib
# Change the GPU architecture (-arch) if necessary
vim setup.py
比如我的是K80的,就选将-arch=sm_37,直接搜素-arch,改这个参数就好了。
3. 这个是在lib文件下运行的
make clean
make
cd ..
make貌似会报一个错误,参考这篇博文https://blog.csdn.net/qwe2508/article/details/81368483就可以解决。
4. Install the Python COCO API. The code requires the API to access COCO dataset.
cd data
git clone https://github.com/pdollar/coco.git
cd coco/PythonAPI
make
cd ../../..
如果发现无法clone的话就直接复制网址下载吧,不过名字可能有区别,注意这些 ,最好把下载的名字改成coco
5. Download pre-trained model
# Resnet101 for voc pre-trained on 07+12 set
./data/scripts/fetch_faster_rcnn_models.sh
这个有时也不能运行不知道为什么,但是万能的博主提供了一个百度云https://pan.baidu.com/s/1kWkF3fT,下载后的东西放在data里面就好了
6. Create a folder and a soft link to use the pre-trained model
你需要cd到在tf-faster-rcnn根目录下操作
NET=res101
TRAIN_IMDB=voc_2007_trainval+voc_2012_trainval
mkdir -p output/${NET}/${TRAIN_IMDB}
cd output/${NET}/${TRAIN_IMDB}
ln -s ../../../data/voc_2007_trainval+voc_2012_trainval ./default
cd ../../..
7. Demo for testing on custom images
# at repository root
GPU_ID=0
CUDA_VISIBLE_DEVICES=${GPU_ID} ./tools/demo.py
这个如果无法运行就直接找到demo.py,然后直接python demo.py就ok了,可能会报路径问题,找不到训练好的模型,这个错误比较简单,直接把模型放在找不到的那个文件路径下面就好了。根据错误提示,相信你没问题。
参考博文:
https://blog.csdn.net/qwe2508/article/details/81368483
https://github.com/endernewton/tf-faster-rcnn