ubuntu安装caffe2

1. 下载文件

conda install

报错:

>>> from caffe2.python import core
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/chenjun/anaconda2/envs/caffe36/lib/python3.6/site-packages/caffe2/python/__init__.py", line 2, in 
    from caffe2.proto import caffe2_pb2
  File "/home/chenjun/anaconda2/envs/caffe36/lib/python3.6/site-packages/caffe2/proto/caffe2_pb2.py", line 6, in 
    from google.protobuf.internal import enum_type_wrapper
ModuleNotFoundError: No module named 'google'
>>> 

解决:

conda install protobuf

报错

>>> from caffe2.python import core
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/chenjun/anaconda2/envs/caffe36/lib/python3.6/site-packages/caffe2/python/core.py", line 9, in 
    from past.builtins import basestring
ModuleNotFoundError: No module named 'past'
>>> 

解决方案:

conda install future

报错3:

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/iot1/miniconda2/envs/caffe/lib/python3.6/site-packages/caffe2/python/__init__.py", line 2, in 
    from caffe2.proto import caffe2_pb2
  File "/home/iot1/miniconda2/envs/caffe/lib/python3.6/site-packages/caffe2/proto/caffe2_pb2.py", line 23, in 
    serialized_pb=_b('\n\x19\x63\x61\x66\x66\x65\x32/proto/caffe2.proto\x12\x06\x63\x61\x66\x66\x65\x32\"\xe1\x01\n\x11\x45xternalDataProto\x12K\n\x0bsource_type\x18\x01 \x01(\x0e\x32$.caffe2.ExternalDataProto.SourceType:\x10INLINE_CONTAINER\x12\x11\n\trecord_id\x18\x02 \x01(\t\x12\x13\n\x0brecord_size\x18\x05 \x01(\x04\x12\x11\n\x06offset\x18\x03 \x01(\x03:\x01\x30\x12\x0f\n\x07strides\x18\x04 \x03(\x03\"3\n\nSourceType\x12\x14\n\x10INLINE_CONTAINER\x10\x00\x12\x0f\n\x0bSIMPLE_FILE\x10\x01\"\xd1\x05\n\x0bTensorProto\x12\x0c\n\x04\x64ims\x18\x01 \x03(\x03\x12\x36\n\tdata_type\x18\x02 \x01(\x0e\x32\x1c.caffe2.TensorProto.DataType:\x05\x46LOAT\x12<\n

解决方案:安装protobuf=3.6.1
conda install protobuf=3.6.1

你可能感兴趣的:(深度学习)