沈阳网站设计开发seo关键词排名优化官网
沈阳网站设计开发,seo关键词排名优化官网,一条龙建站,中国水土保持生态环境建设网站按照官网 的提示#xff0c;我开始安装faster rcnn#xff0c;但是出现了很多问题#xff0c;我将其汇总了起来#xff0c;并提出了解决办法。 先说明一下我的配置#xff1a;
python : anaconda2linux: centos 6.9
安装faster rcnn请先参考#xff1a;《cuda8cudnn4 F…按照官网 的提示我开始安装faster rcnn但是出现了很多问题我将其汇总了起来并提出了解决办法。 先说明一下我的配置
python : anaconda2linux: centos 6.9
安装faster rcnn请先参考《cuda8cudnn4 Faster R-CNN安装塈运行demo》 与 《使用cuDNN5编译py-faster-rcnn错误cudnn.hpp(126): error: argument of type “int” is incompatible …》 要先合一下版本。
问题及解决方法
1.第三步Build the Cython modules 出现如下错误 解决方法 这个问题困扰了我好久经过不断查阅资料我终于解决了此问题。该问题主要是anaconda的 distutils.extension 在编译nms.gpu_nms出现的问题。 我的解决方法 先定位到$FRCN_ROOT/lib再打开setup.py注释掉nms.gpu_nms模块
# Extension(nms.gpu_nms,
# [nms/nms_kernel.cu, nms/gpu_nms.pyx],
# library_dirs[CUDA[lib64]],
# libraries[cudart],
# languagec,
# runtime_library_dirs[CUDA[lib64]],
# # this syntax is specific to this build system
# # were only going to use certain compiler args with nvcc and not with
# # gcc the implementation of this trick is in customize_compiler() below
# extra_compile_args{gcc: [-Wno-unused-function],
# nvcc: [-archsm_35,
# --ptxas-options-v,
# -c,
# --compiler-options,
# -fPIC]},
# include_dirs [numpy_include, CUDA[include]]
# ),然后先编译其他三个模块bboxnms.cpu_nmspycocotools._mask。 等到编译结束后再回过来将上面的注释去掉重新编译会发现出现刚才的问题此时直接复制出错的命令将其中的“-R”换成“-Wl,-rpath”已验证或者”-Wl,-R”已验证**再直接运行修改后的命令如下
g -pthread -shared -B /data1/caiyong.wang/bin/anaconda2/compiler_compat -L/data1/caiyong.wang/bin/anaconda2/lib -Wl,-rpath/data1/caiyong.wang/bin/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/nms/nms_kernel.o build/temp.linux-x86_64-2.7/nms/gpu_nms.o -L/usr/local/cuda/lib64 -L/data1/caiyong.wang/bin/anaconda2/lib -Wl,-rpath/usr/local/cuda/lib64 -lcudart -lpython2.7 -o /data1/caiyong.wang/program/faster_rcnn/py-faster-rcnn/lib/nms/gpu_nms.so最后我们再重新运行一下make命令注意此时setup.py恢复与以前一样发现所有的模块都已经编译完成。 【result】
[caiyong.wanglocalhost lib]$ make
python setup.py build_ext --inplace
running build_ext
skipping utils/bbox.c Cython extension (up-to-date)
skipping nms/cpu_nms.c Cython extension (up-to-date)
skipping nms/gpu_nms.cpp Cython extension (up-to-date)
skipping pycocotools/_mask.c Cython extension (up-to-date)
rm -rf build也有人建议直接将anaconda换成Anaconda3-4.4.0-Linux-x86_64.sh 可以避免出现这个错误。 参考文献
https://github.com/cupy/cupy/issues/599https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-rhttp://www.cnblogs.com/jianyingzhou/p/7722570.htmlhttps://github.com/rbgirshick/py-faster-rcnn/issues/706
2. src/caffe/test/test_smooth_L1_loss_layer.cpp:11:35: fatal error: caffe/vision_layers.hpp: No such file or directory
解决方案直接删除这一行就好了
###3. 运行 make runtest -j8 出现了找不到so的问题分别如下 1). libcudart.so.8.0: cannot open shared object file: No such file or directory 解决方法 在home目录下打开.bashrc输入
export LD_LIBRARY_PATH/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export PATH/usr/local/cuda-8.0/bin:$PATH然后执行source ~/.bashrc 2).error while loading shared libraries: libglog.so.0: cannot open shared object file: No such file or directory 解决方法 首先发现libglog.so.0在/usr/local/lib/,因此只需要加入环境变量即可。 在home目录下打开.bashrc输入
export LD_LIBRARY_PATH/usr/local/lib/:$LD_LIBRARY_PATH然后执行source ~/.bashrc 3). error while loading shared libraries: libhdf5_hl.so.100 解决方法
如果已经安装了hdf5则同理如上将lib路径加入到path中。否则安装hdf5.
安装hdf5,可以直接sudo装默认装在/usr/local/hdf5**, 即
sudo yum install hdf5-devel
如果没有sudo权限则可以使用源码安装 在官网下载源代码然后根据提示安装。 这里需要注意的是, 当运行到 ./configure --prefix/**/hdf5-X.Y.Z/ more configure_flags 需要将/**/hdf5-X.Y.Z/替换到自己可以读写的目录下另外如果出现Syntax error near unexpected token newline’可以参考
《Syntax error near unexpected token newline’ while installing Predictionio》解决或者直接将要安装的HDF5文件拷贝到安装路径下使用hdf5默认的路径一般为当前拷贝的路径下面。可以通过运行命令 ./configure --enable-cxx查看。 完整的安装代码为
$ gunzip hdf5-X.Y.Z.tar.gz | tar xf -
$ cd hdf5-X.Y.Z
$ ./configure --prefix /**/hdf5-X.Y.Z/ more configure_flags
$ make
$ make check # run test suite.
$ make install
$ make check-install # verify installation.最后在makefile.conf中加入
INCLUDE_DIRS : $(PYTHON_INCLUDE) /usr/local/include /**/hdf5-X.Y.Z/hdf5/include
LIBRARY_DIRS : $(PYTHON_LIB) /usr/local/lib /usr/lib /**/hdf5-X.Y.Z/hdf5/lib【注意】
如果安装过 anaconda 的话那 libhdf5-serial-dev 可以不装。如果编译时提示找不到 hdf5 的库。就把 anaconda/lib 加到 ld.so.conf 中去。$ sudo vim /etc/ld.so.conf添加一行,用户名改为你自己的:
/home/your_username/anaconda/lib
关闭并保存文件。$ sudo ldconfig参考文献
在Matlab中使用Caffe出现HDF5 library version mismatched error的解决办法在centos7上配置caffe所遇到的一些问题http://coldmooon.github.io/2015/08/03/caffe_install/
4).error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory 解决方案 同理找到python lib我这里是anaconda的位置将其加入环境变量即可。
4. libprotobuf error in “make runtest”
运行make runtest时出现如下错误
[ RUN ] SGDSolverTest/1.TestLeastSquaresUpdateLROneHundredth
libprotobuf ERROR google/protobuf/text_format.cc:169] Error parsing text-format caffe.SolverParameter: 1:23: Expected identifier.
F1018 01:39:16.016651 8291 test_gradient_based_solver.cpp:56] Check failed: google::protobuf::TextFormat::ParseFromString(proto, param)
*** Check failure stack trace: *** 0x7f66fa250a5d google::LogMessage::Fail() 0x7f66fa254ef7 google::LogMessage::SendToLog() 0x7f66fa252d59 google::LogMessage::Flush() 0x7f66fa25305d google::LogMessageFatal::~LogMessageFatal() 0x8fb1c1 caffe::GradientBasedSolverTest::InitSolverFromProtoString() 0x8e6a93 caffe::GradientBasedSolverTest::RunLeastSquaresSolver() 0x8f16db caffe::GradientBasedSolverTest::TestLeastSquaresUpdate() 0x966cc3 testing::internal::HandleExceptionsInMethodIfSupported() 0x95eac7 testing::Test::Run() 0x95eb6e testing::TestInfo::Run() 0x95ec75 testing::TestCase::Run() 0x960f08 testing::internal::UnitTestImpl::RunAllTests() 0x961197 testing::UnitTest::Run() 0x5257af main 0x3d21a1ed1d (unknown) 0x525355 (unknown)
make: *** [runtest] Aborted (core dumped)
原因是 yum install protobuf-devel的版本太低了使用protoc --version ,发现我的版本是
$ protoc --version
libprotoc 2.3.0
而caffe-master使用的protobuf版本是2.5.0及以上因此更新protobuf可以解决。 但是实际上通过anaconda的pip安装时会安装protobuf的python版本发现我的版本是3.4.0而caffe编译时却链接的是yum install安装的protobuf,版本太低因此需要在本地目录下安装与anaconda匹配的protobuf 3.4.0,
另外似乎caffe支持2.6.1更好而且更重要的是2.6.1版本的protobuf在手动安装的时候出错很少因此先pip uninstall protobuf,再pip安装指定的protobuf即pip install protobuf2.6.1 . 此为python的版本。
接下来手动安装protobuf。 解决方法
从http://download.csdn.net/download/liangyihuai/9534593下载protobuf-2.6.1或从其他地方下载protobuf-2.6.1·.tar.gz。 认真阅读gitHub上给出的安装教程。
$./autogen.sh(在csdn下载的可以省略)
$./configure --prefix/home/**/protobuf 自己的目录下
$ make
$ make check
$ make install编译成功后将export PATH/home/**/protobuf/bin:$PATH加入到环境变量中最后输入 protoc --version命令如显示protobuf-**则安装成功。make check的结果
此时protobuf安装成功我们进入caffe目录下进行make clean再重新编译安装。 5. cannot find -lopencv_dep_cudart 参考 https://github.com/opencv/opencv/issues/6542
caffe编译报错build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const, int)等 https://blog.csdn.net/weixin_41770169/article/details/90413895 解决步骤
1查看opencv类型
pkg-config opencv --modversion
2.4.9.1
因此不能通过放开makefile.config中的opencv_version:3的方式
2修改makefile.config和makefile
makefile文件
LIBRARIES opencv_core opencv_highgui opencv_imgproc 后加上opencv_imagecodecs
makefile.config文件添加
LINKFLAGS : -Wl,-rpath,/home/xuqiong/anaconda2/lib
3重新编译成功
sudo make clean
sudo make all -j8
参考
https://github.com/BVLC/caffe/issues/2348#issuecomment-286491394
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/87033.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!