如果使用fastRCNN跑demo

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

https://blog.csdn.net/Alicehzj/article/details/77934245

https://www.cnblogs.com/toone/p/8433581.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值