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
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
The solution is:
- 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.
Install the latest version of eigen from http://eigen.tuxfamily.org/index.php?title=Main_Page .
Extract the file wherever you want and rename it to
eigen3
.cd /usr/include
sudo rm -rf eigen3/
Place the file you just extracted with
sudo mv path/of/eigen3 /usr/include/
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!