ubuntu 16.04 cuda 8.0 opencv3.1.0 安裝caffesudo
warnning:
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
1. 從CUDA 8.0開(kāi)始compute capability?2.0和2.1被棄用了镊尺,所以可以將-gencode arch=compute_20,code=sm_20 和-gencode arch=compute_20,code=sm_21這兩行刪除扯旷。
2.這個(gè)是與GPU的計(jì)算能力相關(guān)的
附上源碼:
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
3.關(guān)于如何設(shè)置計(jì)算能力,NVIDIA官方文檔在這里http://docs.nvidia.com/cuda/cu ... ility
4. No module named _caffe 和No module named caffe錯(cuò)誤解決
2017年05月29日 16:14:41
閱讀數(shù):8215
1罚勾,在代碼中進(jìn)行 import caffe 后報(bào)錯(cuò)ImportError:No module named _caffe
? ? ?因?yàn)槲绎@卡之前出錯(cuò)了,重現(xiàn)編譯了caffe 勺馆,后面導(dǎo)致如上問(wèn)題库物,解決方法如下:
? ? cd caffe ?#進(jìn)入caffe目錄,可能你的是cd caffe-master
? ? sudo make clean #清除原編譯
? ? sudo make -j4 ?# make -j4或者make -j8 這根據(jù)你自己電腦來(lái)定
? ? sudo make pycaffe ? #最關(guān)鍵的一個(gè)
? ? sudo ?make runtest ? #測(cè)試編譯
2签舞,在代碼中進(jìn)行 import caffe 后報(bào)錯(cuò)ImportError:No module named caffe,可能就是路徑的問(wèn)題了
? ? 在代碼中添加:
? ?import os,sys
? ?caffe_root='/home/ubuntu/caffe' # caffe的根目錄
? ?os.chdir(caffe_root) ?#os.chdir()用于改變當(dāng)前工作目錄到指定的路徑
? ?sys.path.insert(0,caffe_root+'python)
? ?import caffe 就沒(méi)問(wèn)題了秕脓,或者參考http://blog.csdn.net/striker_v/article/details/51596628