![](https://i-blog.csdnimg.cn/blog_migrate/82880e5a19f20a1bdab8d818969ead5f.png)
![](https://i-blog.csdnimg.cn/blog_migrate/2685ab81b46a10803251446fac4a6022.png)
参考,https://github.com/bearpaw/Install-OpenCV/blob/master/Ubuntu/2.4/opencv2_4_9.sh,傻瓜式安装opencv2版本
使用命令:sudo apt-get install libsnappy-dev,安装该库
安装好该库后,回到caffe根目录下,make clean,后再次进行make(一定进行make clean)
又报了新的错误,继续补坑
![](https://i-blog.csdnimg.cn/blog_migrate/abae4eed51e013f379b89f330220e281.png)
![](https://i-blog.csdnimg.cn/blog_migrate/aa347f9f0219e1575acbbba5bae2e07d.png)
参考https://blog.csdn.net/isuccess88/article/details/70165726
参考https://github.com/BVLC/caffe/issues/2348#issuecomment-95156848,make clean,然后创建build文件夹,使用cmake ..
![](https://i-blog.csdnimg.cn/blog_migrate/5afc71bbf42a226b033f7008eddbb472.png)
![](https://i-blog.csdnimg.cn/blog_migrate/92874fea34dc86af7c1a0ea755ad96e3.png)
![](https://i-blog.csdnimg.cn/blog_migrate/cb4a08f1ccb86a1cdce222a20a1f5490.png)
![](https://i-blog.csdnimg.cn/blog_migrate/7056d1d03108d18988c99aa858113d16.png)
最终我参考了caffe官网 ,跑通了caffe(最终没有在caffe目录下直接make 因为总是报错)
mkdir build
cd build
cmake ..
make all
make install
make runtest
![](https://i-blog.csdnimg.cn/blog_migrate/bd20bd5c930ffc3f5f04b0ec37ba3f15.png)
下一步进行编译pycaffe,在当前caffe根目录的python环境,导入import caffe出错
![](https://i-blog.csdnimg.cn/blog_migrate/f40c897d63217d4280b2fb26a20da570.png)
![import caffe导入成功](https://i-blog.csdnimg.cn/blog_migrate/8c989b852a8f67eb7ecd0e18785e2356.png)
![](https://i-blog.csdnimg.cn/blog_migrate/13787691840bf9773f4ed675e7c76d6f.png)
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
![](https://i-blog.csdnimg.cn/blog_migrate/ecac559a5d303819dc743d7ebe05cbd6.png)
![](https://i-blog.csdnimg.cn/blog_migrate/1622e31d0d1c2f418b949a3f20a93d94.png)