Caffe安装中多版本protoc选择问题

编译caffe时

问题:

 

In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:0:
.build_release/src/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
.build_release/src/caffe/proto/caffe.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update


原因:我用python去编译caffe时缺少protoc, 我conda install protobuf. 所以电脑在有两个protoc。

 

解决:

参考:http://blog.csdn.net/elysion122/article/details/64523339

            http://blog.csdn.net/a237072751/article/details/78716778

若想用/usr/bin/protoc则:

  Caffe安装中多版本protoc选择问题_第1张图片

若使用anaconda中的,则:

Caffe安装中多版本protoc选择问题_第2张图片

 

如果选择/usr/bin/protoc,在编译pycaffe时又想用anconda,那只能把anconda的protoc装成和系统一个版本

直接用conda install protobuf-2.6.1会出现找不到源的问题,

用命令:

conda install -c anaconda protobuf=2.6.1

 

如果还是找不到源

 

binstar search -t conda protobuf

假设使用protobuf-3.5.1版本,找到

 

Caffe安装中多版本protoc选择问题_第3张图片

然后用

 

binstar show conda-forge/protobuf


找到地址链接

 

Caffe安装中多版本protoc选择问题_第4张图片

然后终端输入

 

conda install --channel https://conda.anaconda.org/conda-forge protobuf


安装

 

 

另清华大学开源软件镜像站

 

 

地址:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

 

 

 

 

 

 

你可能感兴趣的:(python,caffe,buffer)