Error related to Eigen while installing Caffe2

http://www.mamicode.com/info-detail-2041848.html


caffe2的安装的使用过程中出现了一些有意思的问题,现在将遇到的问题及其解决方法简单记录一下。

1. 首先caffe2 在安装过程中需要使用 git clone, 其中的--recuresive不能丢掉,否则会无法下载第三方库;

2. make 过程中会出现Eigen相关的错误,可以通过修改caffe2的Dependency.cmake 文件夹关于Eigen的部分,具体如下:

原版的cmake文件会首先寻找系统自带的Eigen,我的Eigen不知为何与caffe2自带的Eigen不一致,所以我们将源文件第220行左右的如下部分:

# ---[ EIGEN
#set(EIGEN_MPL2_ONLY 1)
#find_package(Eigen3 QUIET)
#if(EIGEN3_FOUND)
#  caffe2_include_directories(${EIGEN3_INCLUDE_DIRS})
#else()
#  caffe2_include_directories(${PROJECT_SOURCE_DIR}/third_party/eigen)
#endif()

改为:
caffe2_include_directories(${PROJECT_SOURCE_DIR}/third_party/eigen)

即可使用caffe2自带的Eigen版本。

3. 安装完成并测试完毕后我们会发现想在pycharm中无法正常import caffe2.python 那么我们可以通过修改pycharm的启动文件来解决这个问题,具体方式如下:

在pycharm.sh 中添加

export PYTHONPATH=/caffe2/caffe2/python:/caffe2/build:$PYTHONPATH

即可,注意需要修改caffe2的路径

Reference:

1.http://blog.csdn.net/u013010889/article/details/70808866

2.http://www.cnblogs.com/darkknightzh/p/5896446.html

ubuntu 14.04: caffe2 的安装,pycharm的配置, anaconda的使用



https://stackoverflow.com/questions/49082293/error-related-to-eigen-while-installing-caffe2

Error related to Eigen while installing Caffe2

I'm getting an error while installing Caffe2. After the succesful build, in the sudo make install step, it throws an error as #error Caffe2 requires Eigen to be at least 3.3.0

up vote 6 down vote accepted

The solution is:

  1. Check the Eigen version with: cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION

It will show some version variable values like below:

EIGEN_WORLD_VERSION 3 EIGEN_MAJOR_VERSION 2 EIGEN_MINOR_VERSION 192

These values are telling your problem directly. Your Eigen version is 3.2.192 instead of 3.3.0. So we need to upgrade this package.

  1. Install the latest version of eigen from http://eigen.tuxfamily.org/index.php?title=Main_Page .

  2. Extract the file wherever you want and rename it to eigen3.

  3. cd /usr/include

  4. sudo rm -rf eigen3/

  5. Place the file you just extracted withsudo mv path/of/eigen3 /usr/include/

  6. Lastly check the version again with cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION

You should see these variables:

EIGEN_WORLD_VERSION 3 EIGEN_MAJOR_VERSION 3 EIGEN_MINOR_VERSION 4

You can run sudo make install again in the caffe2 directory and you will see that everything will be installed succesfully!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值