我正在尝试在macbook pro上安装caffe2。我遵循了官方的指示:https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=compile#python-configuration
我成功地从源代码构建了它,但是当我尝试该命令时:
~/anaconda2/bin/python -c 'from caffe2.python import core' 2>/dev/null & echo "Success" | echo "Failure"上面写着:
Failure
'~/anaconda2/bin/python -c 'from…' has ended我不知道它出了什么问题。我的电脑有两个不同版本的python。默认是目录'/usr/bin/ python‘中的python 2.7.10。另一个是目录'~/anaconda2/bin‘中的python 2.7.13。我不知道它使用的是哪一个。使用以下命令:
mkdir build && cd build
cmake -DUSE_CUDA=OFF ..
sudo make install我安装成功了。我还在~/.bash_profile中设置了PYTHONPATH环境变量export PYTHONPATH="~/anaconda2/bin/",并执行以下命令:
sudo install_name_tool -change libpython2.7.dylib ~/anaconda2/lib/libpython2.7.dylib /usr/local/caffe2/python/caffe2_pybind11_state.so直到现在,一切都很好。但是当我执行的时候:
~/anaconda2/bin/python -c 'from caffe2.python import core' 2>/dev/null & echo "Success" | echo "Failure"它显示“失败”,我也尝试过:
python -c 'from caffe2.python import core' 2>/dev/null & echo "Success" | echo "Failure"但它并没有起作用。我该怎么办?
发布于 2018-01-16 11:54:06
在conda/build.sh中,用BLAS=Eigen替换BLAS=MKL
CMAKE_ARGS+=("-DBLAS=MKL") # gives unresolved dnnBatchNormalizationCreateForward_v2_F32
CMAKE_ARGS+=("-DMKL_INCLUDE_DIR=$CONDA_PREFIX/include")
CMAKE_ARGS+=("-DBLAS=Eigen")在conda/meta.yaml中注释掉对MKL build的引用:
# - mkl-include
# - mkl运行:
# - mkl-include
# - mklhttps://stackoverflow.com/questions/48050437
复制相似问题