【软件安装】caffe + python3.7 问题

安装caffe的python接口,即运行 make pycaffe 时出现以下问题:

CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
In file included from python/caffe/_caffe.cpp:17:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/usr/local/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
python/caffe/_caffe.cpp:379:1: warning: unused typedef 'assertion' [-Wunused-local-typedef]
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(SolveOverloads, Solve, 0, 1);
^
/usr/local/include/boost/python/detail/defaults_gen.hpp:375:5: note: expanded from macro 'BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS'
    BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(                                                     \
    ^
/usr/local/include/boost/python/detail/defaults_gen.hpp:276:9: note: expanded from macro 'BOOST_PYTHON_GEN_MEM_FUNCTION_STUB'
        BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts)            \
        ^
/usr/local/include/boost/python/detail/defaults_gen.hpp:216:46: note: expanded from macro 'BOOST_PYTHON_OVERLOAD_CONSTRUCTORS'
                N,n_args>::too_many_keywords assertion;                                     \
                                             ^
python/caffe/_caffe.cpp:379:1: warning: unused typedef 'assertion' [-Wunused-local-typedef]
/usr/local/include/boost/python/detail/defaults_gen.hpp:375:5: note: expanded from macro 'BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS'
    BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(                                                     \
    ^
/usr/local/include/boost/python/detail/defaults_gen.hpp:276:9: note: expanded from macro 'BOOST_PYTHON_GEN_MEM_FUNCTION_STUB'
        BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts)            \
        ^
/usr/local/include/boost/python/detail/defaults_gen.hpp:225:46: note: expanded from macro 'BOOST_PYTHON_OVERLOAD_CONSTRUCTORS'
                N,n_args>::too_many_keywords assertion;                                     \
                                             ^
3 warnings generated.
ld: library not found for -lboost_python3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [python/caffe/_caffe.so] Error 1

解决:

      终于在github上找到了解决方案,问题原因应该是我安装的是python3.7,虽然安装了对应boost版本,但在Makefile.config文件中PYTHON_LIBRARIES变量还是被注释状态,修改为以下表达式再运行make pycaffe成功

     PYTHON_LIBRARIES := boost_python37 python3.7m

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值