protobuf和caffe

时间:2015-07-09 02:38:18

标签: protocol-buffers caffe

从过去的两天开始,我一直在尝试在OSX 10.10上安装caffe

我能够成功运行caffe的所有安装命令但是当我尝试在ipython中导入caffe时,我得到了完全相同的错误:https://github.com/BVLC/caffe/issues/2092

因此,正如线程中所建议的那样,我尝试将protobuf从3.0.0降级到2.6.1。我成功地安装了protoc,新版本确实安装了2.6.1

但是现在我无法安装protobuf python库。我按照此处提到的说明进行操作:https://github.com/google/protobuf/tree/v2.6.1/python 运行命令python setup.py google_test时出现以下错误:

  

来自google.protobuf import descriptor_pb2

     

文件“/path/to/protobuf-2.6.1/python/google/protobuf/descriptor_pb2.py”,   第21行,在模块>

中      

80 \ X80 \ X80 \ X02 \“} \ n \ X10 \ x45numValueOptions \ X12 \ X19 \ n \ ndeprecated \ X18 \ X01   \ X01(\ X08:\ X05 \ X66 \ x61lse \ X12 \ X43 \ n \ x14uninterpreted_option \ X18 \ XE7 \ X07   \ X03(\ X0B \ X32 $ .google.protobuf.UninterpretedOption * \ t \ X08 \ xe8 \ X07 \ X10 \ X80 \ X80 \ X80 \ X80 \ X02 \“{\ n \ x0eServiceOptions \ X12 \ X19 \ n \ ndeprecated \ X18!   \ X01(\ X08:\ X05 \ X66 \ x61lse \ X12 \ X43 \ n \ x14uninterpreted_option \ X18 \ XE7 \ X07   \ X03(\ X0B \ X32 $ .google.protobuf.UninterpretedOption * \ t \ X08 \ xe8 \ X07 \ X10 \ X80 \ X80 \ X80 \ X80 \ X02 \“Z \ n \ rMethodOptions \ X12 \ X19 \ n \ ndeprecated \ X18!   \ X01(\ X08:\ X05 \ X66 \ x61lse \ X12 \ X43 \ n \ x14uninterpreted_option \ X18 \ XE7 \ X07   \ X03(\ X0B \的X32 $ .google.protobuf.UninterpretedOption * \吨\ X08 \ xe8 \ X07 \ X10 \ X80 \ X80 \ X80 \ X80 \ X02 \“\ x9e \ X02 \ n \ x13UninterpretedOption \ X12; \ n \ x04name \ X18 \ X02   \ X03(\ X0B \ X32-.google.protobuf.UninterpretedOption.NamePart \ X12 \ X18 \ n \ x10identifier_value \ X18 \ X03   \ X01(\吨\ X12 \ X1A \ n \ x12positive_int_value \ X18 \ X04   \ X01(\ X04 \ X12 \ X1A \ n \ x12negative_int_value \ X18 \ X05   \ X01(\ X03 \ X12 \ X14 \ n \ X0C \ x64ouble_value \ X18 \ X06   \ X01(\ X01 \ X12 \ X14 \ n \ x0cstring_value \ X18 \ X07   \ X01(\ X0C \ X12 \ X17 \ n \ X0F \ x61ggregate_value \ X18 \ X08   \ X01(\吨\ X1A \ X33 \ n \ x08NamePart \ X12 \ X11 \ n \ tname_part \ X18 \ X01   \ X02(\吨\ X12 \ X14 \ n \ x0cis_extension \ X18 \ X02   \ X02(\ X08 \“\ XB1 \ X01 \ n \ x0eSourceCodeInfo \ X12:\ n \ x08location \ X18 \ X01   \ X03(\ X0B \ X32(.google.protobuf.SourceCodeInfo.Location \ X1A \ X63 \ n \ x08Location \ X12 \ X10 \ n \ x04path \ X18 \ X01   \ X03(\ X05 \ X42 \ X02 \ X10 \ X01 \ X12 \ X10 \ n \ x04span \ X18 \ X02   \ X03(\ X05 \ X42 \ X02 \ X10 \ X01 \ X12 \ X18 \ n \ x10leading_comments \ X18 \ X03   \ X01(\吨\ X12 \ X19 \ n \ x11trailing_comments \ X18 \ X04   \ X01(\ TB)\ n \ X13 \ x63om.google.protobufB \ X10 \ X44 \ x65scriptorProtosH \ X01' )

     

TypeError: init ()得到了一个意外的关键字参数'syntax'

Google没有太多内容。请帮忙。

1 个答案:

答案 0 :(得分:0)

我正在使用brew和pip并且工作正常,请尝试对protobuf 2.6.0进行全新安装,如下所示:

# First, uninstall protobuf
# Then let's install protobuf 2.6.0 for Mac
brew install homebrew/versions/protobuf260
# And install the corresponding python library version
pip install protobuf==2.6.0

我在这里使用2.6.0因为2.6.1似乎尚未提供brew。