安裝 google 輸入法
http://blog.csdn.net/baobao3456810/article/details/52055938
安裝nvidia顯卡驅動
step1.
http://www.geforce.cn/drivers 下載相應的顯卡驅動版本。
step2. Ubuntu系統集成的顯卡驅動是nouveau,它是第三方爲NVIDIA開發的開源驅動,我們需要先將其屏蔽才能安裝NVIDIA官方驅動。
參考 http://blog.csdn.net/u012581999/article/details/52433609
之後遇到這個問題:
you appear to be running an x server please exit x before installing按住ctrl+alt+F1 進入控制檯
sudo init 3 注意空格 會做掉x
rm /tmp/.X*
上面的命令是刪掉X 的鎖文件
step3. 繼續安裝顯卡驅動
$sudo service lightdm stop
再安裝驅動程序
$sudo sh NVIDIA-Linux-x86_64-xxx.run
最後重新啓動圖形環境
$sudo service lightdm start
通過以下命令確認驅動是否正確安裝。
cat /proc/driver/nvidia/version
安裝cuda-8.0
參考:https://shreyasskandan.github.io/caffe_linux_blogpost.html
參考官方網站:http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-installation
安裝cudnn:
cd home/ubuntu/Downloads/
tar zxvf cudnn-8.0-linux-x64-v5.1.tgz#解壓文件
cd進入cudnn5.1解壓之後的include目錄,在命令行進行如下操作:
sudo cp cudnn.h /usr/local/cuda/include/#複製頭文件
再cd進入lib64目錄下的動態文件進行復制和鏈接:(5.1.5爲對應版本具體可修改)
sudo cp lib* /usr/local/cuda/lib64/ #複製動態鏈接庫
cd /usr/local/cuda/lib64/
sudo rm -rf libcudnn.so libcudnn.so.5 #刪除原有動態文件
sudo ln -s libcudnn.so.5.1.5 libcudnn.so.5 #生成軟銜接
sudo ln -s libcudnn.so.5 libcudnn.so #生成軟鏈接
安裝OpenCV:
參考 http://blog.csdn.net/tingyue_/article/details/45619297
無cuda安裝可按照如下步驟來
首先安裝依賴項:
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libswscale-dev libjasper-dev
cd /path/to/opencv-master
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv2.4.10_nocuda -D WITH_CUDA=OFF ..
make
sudo make install
安裝pvanet:
作者的github地址
https://github.com/sanghoon/pva-faster-rcnn
問題一:fatal error:hdf5.h:沒有那個文件或目錄
參考:http://blog.csdn.net/xue_wenyuan/article/details/5203712
bashrc中添加 export PYTHONPATH=$PYTHONPATH:/home/steven/pva-faster-rcnn/caffe-fast-rcnn/python
編譯完caffe之後,還需要安裝以下一些庫
sudo pip install cython
sudo apt-get install gfortran
sudo pip install -U scikit-image
sudo pip install easydict
Google Protobuffer 相關的錯誤:
1.
ImportError: No module named google.protobuf.internal
使用了從源碼安裝的protobuf, 在/usr/lib/中 安裝了 libprotobuf.so.12.0.0
使用pip在 /usr/local/lib/python2.7/dist-packages/ 中安裝了 google/protobuf/...
2. 在編譯caffe階段
lib/libcaffe.so: undefined reference to `google::protobuf::io::
原因: 需要python 的庫路徑
方法: 安裝protobuf-2.6.1
$ ./configure --prefix=/usr/lib
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.
export PYTHONPATH=/home/cuizhou/Downloads/protobuf-2.6.1/python:$PYTHONPATH
3.
./include/caffe/util/cudnn.hpp:8:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
解決方法: 用protoc從caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
steven@steven:~/pva-faster-rcnn/caffe-fast-rcnn/src/caffe/proto$ protoc --cpp_out=/home/steven/pva-faster-rcnn/caffe-fast-rcnn/include/caffe/ caffe.proto運行 tools/demo.py 報錯:
from utils.cython_bbox import bbox_overlaps
ImportError: dynamic module does not define init function (initcython_bbox)
解決方法:進入 lib/fast_rcnn/test.py 修改成 from utils.bbox import bbox_overlaps
Ubuntu重啓後不能進入ubuntu的圖形界面,在登錄界面循環:
sudo reboot
安裝指定版本的tensorflow
sudo pip install \ -i https://pypi.tuna.tsinghua.edu.cn/simple/ \ https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/gpu/tensorflow_gpu-1.0.0-cp27-none-linux_x86_64.whl
tensorflow 運行出現錯誤:
serialized_pb=_b(‘\n/tensorflow/core/framework/resource handle.proto\x12\tensorflow\”m\n\x0eResourceHandle\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tB4\n\x18org.tensorflow.frameworkB\x13ResourceHandleProtoP\x01\xf8\x01\x01\x62\x06proto3’) TypeError: init() got an unexpected keyword argument ‘syntax’
solution:
locate protobuf
import google.protobuf
print google.protobuf.__file__
print google.protobuf.__version__
3.2.0protoc –version
2.6.1
decide to compile protobuf from source code
git clone https://github.com/google/protobuf.git
### readme is very important
sudo apt-get install autoconf automake libtool curl make g++ unzip
./autogen.sh
./configure
make
cd python/
sudo python setup.py install
又遇到:
from pkg_resources import compat31
can not find compat31
原因:
setuptools找到了/usr/lib/python2.7/dist-packges/ 下的pkg_resources,刪除即可。
另外,備份一下StackOverflow上關於這個錯誤的解答:
ImportError: No module named pkg_resources: the solution is to reinstall python pip using the following Command are under.
Step: 1 Login in root user.
sudo su root
Step: 2 Uninstall python-pip package if existing.
apt-get purge -y python-pip (use python3-pip if error is pointing to ../python3/..)
Step: 3 Download files using wget command(File download in pwd )
wget https://bootstrap.pypa.io/get-pip.py (there is version 3.2 available, use that according to your env)
Step: 4 Run python file.
python ./get-pip.py (if error is related to python 3 then you want to use python3 or python3.6 etc. [as per your env.])
Step: 5 Finaly execute installation command.
apt-get install python-pip (again, use python3-pip as in step 2)
Note: User must be root.