Setting up caffe on Ubuntu
Setting up caffe on ubuntu1404 LTS +CUDA7.5 and ubuntu1604 LTS +CUDA8.0
@(sinbad)[360sinbad@gmail.com]
Prepare nVidia driver and CUDA Toolkit
-
Download cuda toolkit 7.5( support ubuntu 1404) or 8.0(support ubuntu 1604) on nvidia web. Now the download page is shown the latest version of cuda toolkit, you should find CUDA Toolkit Archive folder or else you only see current latest version, and choose the compatable version with your system link like as below:
https://developer.nvidia.com/cuda-75-downloads-archive
Now the latest version of CUDA is CUDA 9.0, there are some errors after installing CUDA 9.0 with ubuntu1604 LTS. So i suggest CUDA 8.0 for your choose.Download resource please search Baidu cloud. -
Download GPU Graphics driver on web: http://www.geforce.cn/drivers/results/105888#, choose version depend on your graphics card.
Install CUDA driver and config system env
Step 1. nVidia Graphics Driver and CUDA Toolkit
Forbid nouveau.
sudo gedit /etc/modprobe.d/disable-nouveau.conf
Appending two lines as below.
blacklist nouveau
options nouveau modeset=0
then save and exit: (:wq)
Note: excute lspci | grep nouveau check if nouveau was forbid. If there is nothing to show, you can ignore step above.
Enter TTY Ctrl + Alt +F1
and close GUI
sudo stop lightdm
sudo chmod -x NVIDIA_XXX.run
sudo ./NVIDIA_XXX.run
CUDA Toolkit install
Installation Instructions:
1. sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
2. sudo apt-get update
3. sudo apt-get install cuda
**Step 2.Set up system env for CUDA **
sudo gedit /etc/profile
Appending two lines as below.
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PAT
After saving, create a linkfile through
sudo gedit /etc/ld.so.conf.d/cuda.conf
Add cuda path in the end.
/usr/local/cuda/lib64
Save and reboot the computer.
Download Caffe
After such preparation, now let us start installing caffe.
Download Caffe from ithub.
git clone https://github.com/BVLC/caffe.git
Install several dependencies for caffe
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
Install Python
The main requirements are bumpy and boost.python (provided by boost).
You can install the dependencies with
cd caffe/python/
for req in $(cat requirements.txt); do pip install $req; done
it may meet permission problem.so, try the other command:
cd ~/caffe
sudo pip install -r ./python/requirements.txt
Maybe you install pip first.
sudo apt-get install python-pip
Note: You can use #sudo apt-get install python-numpy python-skimage python-matplotlib if above step failed.
To import the caffe Python module after completing the installation, add the module directory to your $PYTHONPATH
by
export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
Install Matlab 2015b
- Download Matlab 2015b for Linux
Link: http://pan.baidu.com/s/1i5BO0eh password:hraf
- Mount ISO file
sudo mkdir /MATLAB
sudo mount -o loop R2015b_glnxa64.so /MATLAB
- Excute instal without connect Internet. Note: Choose install standalone
cd /MATLAB
sudo ./inatall
- Copy
/crack/bin
tousr/local/MATLAB/R2015b/bin
after installing matlab
sudo cp /[Your crack directory]/R2015b/bin/glnxa64/* /usr/local/MATLAB/R2015b/bin/glnxa64
- Run matlab
cd /usr/local/MATLAB/R2015b/bin
sudo ./matlab
- Umount ISO
sudo umount /matlab
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 现代计算机视觉入门之:什么是图片特征编码
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· Spring AI + Ollama 实现 deepseek-r1 的API服务和调用
· 数据库服务器 SQL Server 版本升级公告
· C#/.NET/.NET Core技术前沿周刊 | 第 23 期(2025年1.20-1.26)
· 程序员常用高效实用工具推荐,办公效率提升利器!