Caffe框架的機器學習——安裝與問題錦集
阿新 • • 發佈:2019-02-02
Ubuntu16.04 python Faster R-CNN
安裝教程:
一、Caffe安裝教程:Ubuntu16.04(CPU)
https://blog.csdn.net/u010193446/article/details/53259294
二、Faster R-CNN 的Caffe實現
https://www.2cto.com/kf/201706/646213.html
三、Faster RCNN CPU模式下進行訓練
https://blog.csdn.net/wjx2012yt/article/details/52197698
安裝問題:
1.
src/caffe/internal_thread.cpp:1:28: fatal error: boost/thread.hpp: 沒有那個檔案或目錄
compilation terminated.
%安裝boost
sudo apt-get install libboost-all-dev
https://blog.csdn.net/Code_My_Life/article/details/45058373
2.
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
sudo python -m pip install --upgrade --force pip
3.
python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: 沒有那個檔案或目錄
sudo apt-get install python-numpy
https://blog.csdn.net/wuzuyu365/article/details/52430657
4.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named caffe
cd caffe #進入caffe目錄,可能你的是cd caffe-master
sudo make clean #清除原編譯
sudo make -j4 # make -j4或者make -j8 這根據你自己電腦來定
sudo make pycaffe #最關鍵的一個
sudo make runtest #測試編譯
A.把環境變數路徑放到 ~/.bashrc檔案中
sudo echo export PYTHONPATH="~/caffe/python" >> ~/.bashrc
B.使環境變數生效
source ~/.bashrc
https://blog.csdn.net/liuweizj12/article/details/521381915.
EnvironmentError: The nvcc binary could not be located in your $PATH. Either add it to your path, or set $CUDAHOME
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
http://tieba.baidu.com/p/53140691346.
from easydict import EasyDict as edict
ImportError: No module named easydictsudo pip install easydict
7.
import cv2
ImportError: No module named cv2
sudo pip install opencv-python
8.
from nms.gpu_nms import gpu_nms
ImportError: No module named gpu_nms
https://blog.csdn.net/tingyue_/article/details/53432071
9.
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
sudo apt-get install python-tk
10.
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0615 15:16:55.504314 1416 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
*** Check failure stack trace: ***
已放棄 (核心已轉儲)
(修改demo檔案)
#if args.cpu_mode:
caffe.set_mode_cpu()
#else:
#caffe.set_mode_gpu()
#caffe.set_device(args.gpu_id)
http://lib.csdn.net/article/deeplearning/50580?knId=1753 (修改demo檔案)
https://blog.csdn.net/wjx2012yt/article/details/52197698
(訓練樣本時出錯問題解決)
11.
win10 Faster-RCNN訓練自己資料集遇到的問題集錦 (轉)
12.
faster r-cnn 在CPU配置下訓練自己的資料
13.
py-faster-rcnn+cpu配置並訓練自己的資料
https://blog.csdn.net/mht1829/article/details/54428012
14.
Faster RCNN CPU模式下進行訓練
https://blog.csdn.net/wjx2012yt/article/details/52197698
15.
將faster rcnn測試結果圖片儲存下來
https://blog.csdn.net/shanshanshans/article/details/78644334
16.
'USE_GPU_NMS': True}
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0617 09:45:08.101810 2373 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
http://www.caffecn.cn/?/question/13
17.
src/caffe/test/test_smooth_L1_loss_layer.cpp:11:35: fatal error: caffe/vision_layers.hpp
找到檔案$CAFFE_ROOT/src/caffe/test/test_smooth_L1_loss_layer.cpp
刪除第十一行
18.
eError: 'module' object has no attribute 'text_format'
在檔案./lib/fast_rcnn/train.py增加一行import google.protobuf.text_format 即可解決問題
作為一個計算機小白,花了好幾天,裝了好幾次,掉進了太多坑,大致把遇到的問題收集了起來T^T~~希望對也要裝這些的小夥伴們能有所幫助。