安装环境 ubuntu16.04
操作系统由于安装了各种 python版本 以及各种anconda版本,protobuf 也不只一种。先欣赏下我服务器的python版本
cuicui@ubuntu:~/python$ whereis python
python: /usr/bin/python3.5 /usr/bin/python2.7-config /usr/bin/python /usr/bin/python3.5m /usr/bin/python2.7 /usr/lib/python3.5 /usr/lib/python2.7 /etc/python3.5 /etc/python /etc/python2.7 /usr/local/lib/python3.5 /usr/local/lib/python2.7 /usr/include/python2.7 /usr/share/python /home/cuicui/anaconda2/bin/python /home/cuicui/anaconda2/bin/python2.7 /home/cuicui/anaconda2/bin/python2.7-config /home/cuicui/anaconda3/bin/python3.6-config /home/cuicui/anaconda3/bin/python /home/cuicui/anaconda3/bin/python3.6m-config /home/cuicui/anaconda3/bin/python3.6 /home/cuicui/anaconda3/bin/python3.6m /usr/share/man/man1/python.1.gz
本人亲试最好用于caffe的还是 /usr/bin/python2.7 + libprotobuf 2.6.1
而anconda2 +python2.7 + libprotobuf2.6.1 尝试了一下,没有成功,也懒得倒腾了。
指定protobuf为2.6.1版本的安装命令为:
sudo apt-get install libprotobuf-dev
令附上 anconda2 中指定protobuf为2.6.1版本的安装命令为:
conda install -c minrk libprotobuf
当然,安装成功后,后面要依赖这些安装,当然要选择对应的python执行,注意查看python是哪个python,我都是这么执行的现在:
CUDA_VISIBLE_DEVICES=5 /usr/bin/python2.7 ***.py