大家好,又见面了,我是你们的朋友全栈君。
参考链接:https://blog.csdn.net/linolzhang/article/details/70306003
代码下载链接:https://github.com/CharlesShang/TFFRCNN
训练好的网络下载链接:
在 TFFRCNN-master 下新建文件夹 model,存放要下载入的 net(参考 Github 下载地址),推荐下载:
2.VGG16 – TFFRCNN (0.689 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagX0JWRlR0cTZ5OGc/view
3.VGG16 – TFFRCNN (0.748 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagVmt5VHlCU25vUEE/view
5.Resnet50 – TFFRCNN (0.712 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagbXk1b0FIeDRJaU0/view
cython
, python-opencv
, easydict
(recommend to install: Anaconda)
1.Clone the Faster R-CNN repository
git clone https://github.com/CharlesShang/TFFRCNN.git
2.Build the Cython modules
cd TFFRCNN/lib
make # compile cython and roi_pooling_op, you may need to modify make.sh for your platform
我在编译过程中遇到了一些错误需要修改lib/make.sh文件(修改如下图红色部分), 我的文件内容如下:
—– Begin ——
#!/usr/bin/env bash TF_INC=(python -c ‘import tensorflow as tf; print(tf.sysconfig.get_include())’) echo TF_INC
TF_LIB=(python -c ‘import tensorflow as tf; print(tf.sysconfig.get_lib())’) echo TF_LIB
CUDA_PATH=/usr/local/cuda/
cd roi_pooling_layer
/usr/local/cuda-9.0/bin/nvcc -std=c++11 -c -o roi_pooling_op.cu.o roi_pooling_op_gpu.cu.cc \ -I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52
## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below #g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o roi_pooling.so roi_pooling_op.cc \ # roi_pooling_op.cu.o -I TF_INC -fPIC -lcudart -L CUDA_PATH/lib64
# for gcc5-built tf #g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=1 -o roi_pooling.so roi_pooling_op.cc \g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o roi_pooling.so roi_pooling_op.cc \ roi_pooling_op.cu.o -I TF_INC -fPIC -lcudart -L CUDA_PATH/lib64 -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework \ -L/usr/local/cuda-9.0/targets/x86_64-linux/lib/ -L
# add building psroi_pooling layer cd psroi_pooling_layer /usr/local/cuda-9.0/bin/nvcc -std=c++11 -c -o psroi_pooling_op.cu.o psroi_pooling_op_gpu.cu.cc \ -I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52
g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o psroi_pooling.so psroi_pooling_op.cc \ psroi_pooling_op.cu.o -I TF_INC -fPIC -lcudart -L CUDA_PATH/lib64i -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework \ -L/usr/local/cuda-9.0/targets/x86_64-linux/lib/ -L
## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below #g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o psroi_pooling.so psroi_pooling_op.cc \ # psroi_pooling_op.cu.o -I TF_INC -fPIC -lcudart -L CUDA_PATH/lib64
cd ..
—– End —–
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/160411.html原文链接:https://javaforall.cn