(1)编译时报错:
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/platform/default/mutex.h:25:22: fatal error: nsync_cv.h: No such file or directory
(之前TFFRCNN-master改用python2.7版本时好像也出了这个问题)
解决办法:
sudo gedit /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/platform/default/mutex.h
添加路径:
#include "/usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public/nsync_cv.h"
#include "/usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public/nsync_mu.h"
(2)跑demo
python ./tools/demo.py --model model/VGGnet_fast_rcnn_iter_70000.ckpt
报错:
tensorflow.python.framework.errors_impl.NotFoundError: /home/carsmart/users/yangxing/TFFRCNN-master/lib/roi_pooling_layer/roi_pooling.so: undefined symbol: _ZTIN10tensorflow8OpKernelE
(TFFRCNN-master改用python2.7版本时一样的问题)
解决办法:修改make.sh文件
TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')
g++ -std=c++11 -shared -o roi_pooling.so roi_pooling_op.cc -D_GLIBCXX_USE_CXX11_ABI=0 \
roi_pooling_op.cu.o -I $TF_INC -L $TF_LIB -ltensorflow_framework -D GOOGLE_CUDA=1 \
-fPIC $CXXFLAGS -lcudart -L $CUDA_PATH/lib64
报错:
ImportError: No module named yaml
解决办法:
sudo apt-get install python-yaml
(3)训练和测试模型
./experiments/scripts/faster_rcnn_end2end.sh gpu 1 VGG16 pascal_voc
报错:
test_net.py: error: argument --weights: expected one argument
这是因为tensorflow问题并没有在/output/faster_rcnn_end2end/voc_2007_trainval 中生成VGGnet_fast_rcnn_iter_70000.ckpt文件
解决办法:
修改:
lib/fast_rcnn/train.py :
from tensorflow.core.protobuf import saver_pb2
self.saver = tf.train.Saver(max_to_keep=100,write_version=saver_pb2.SaverDef.V1)
报错:
grep: experiments/logs/faster_rcnn_end2end_VGG16_.txt.2018-01-04_13-10-24: No such file or directory
解决办法:
1.
在./experiment/下手动添加logs文件夹
2.手动调用训练好的模型去测试
CUDA_VISIBLE_DEVICES="
1
" python ./tools/test_net.py --device gpu --device_id
0
--weights output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt --imdb voc_2007_test --cfg experiments/cfgs/faster_rcnn_end2end.yml --network VGGnet_test