我目前在Macbook上使用python设置caffe。我发誓所有前提条件都可以,但是当我尝试构建caffe时,它会返回错误。怎么了?
这是控制台:
/bin/sh: /usr/local/cuda/bin/nvcc: No such file or directory
awk: syntax error at source line 1
context is
{exit >>> < <<< 7.0;}
awk: illegal statement at source line 1
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
/bin/sh: .build_release/src/caffe/blob.o.warnings.txt: Permission denied
/bin/sh: .build_release/src/caffe/common.o.warnings.txt: Permission denied
/bin/sh: .build_release/src/caffe/data_transformer.o.warnings.txt: Permission denied
/bin/sh: .build_release/src/caffe/internal_thread.o.warnings.txt: Permission denied
cat: .build_release/src/caffe/common.o.warnings.txt: No such file or directory
In file included from src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:8:
In file included from ./include/caffe/common.hpp:19:
./include/caffe/util/device_alternate.hpp:34:10: fatal error: 'cublas_v2.h' file not found
#include <cublas_v2.h>
^
1 error generated.
cat: .build_release/src/caffe/data_transformer.o.warnings.txt: No such file or directory
make: *** [.build_release/src/caffe/common.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [.build_release/src/caffe/blob.o] Error 1
make: *** [.build_release/src/caffe/data_transformer.o] Error 1
cat: .build_release/src/caffe/internal_thread.o.warnings.txt: No such file or directory
make: *** [.build_release/src/caffe/internal_thread.o] Error 1
好的,上述问题已经解决,但是还有另一个问题,有人可以帮助我吗?
sh-3.2# cd /Users/Leo/Documents/caffe
sh-3.2# make all
CXX src/caffe/blob.cpp
In file included from src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:10:
In file included from ./include/caffe/syncedmem.hpp:7:
In file included from ./include/caffe/util/math_functions.hpp:11:
./include/caffe/util/mkl_alternate.hpp:11:10: fatal error: 'cblas.h' file not found
#include <cblas.h>
^
1 error generated.
make: *** [.build_release/src/caffe/blob.o] Error 1
最佳答案
对于其他发现此问题的人。仅当要在其上使用Nvidia卡的计算机上才需要CUDA开发套件。对于大多数Mac用户而言,情况可能并非如此(请检查您的硬件规格)。如果没有这种图形卡,则不能使用CUDA。只需在编译Caffe之前将其禁用即可:
在您的caffe目录中,编辑Makefile.config
取消注释此行:CPU_ONLY := 1
表示不需要CUDA。
关于python - Caffe:差不多完成了,但是停留在最后一步,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31639331/