ImportError:无法导入名称symbol_database

时间:2016-07-21 11:22:03

标签: protocol-buffers caffe

我是caffe的新手。当我尝试咖啡时,问题就出现了。任何人都可以提供帮助吗?提前致谢!

>>> import google.protobuf
>>> import caffe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/llzxo/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
  File "/home/llzxo/caffe/python/caffe/pycaffe.py", line 15, in <module>
    import caffe.io
  File "/home/llzxo/caffe/python/caffe/io.py", line 8, in <module>
    from caffe.proto import caffe_pb2
  File "/home/llzxo/caffe/python/caffe/proto/caffe_pb2.py", line 10, in <module>
    from google.protobuf import symbol_database as _symbol_database
ImportError: cannot import name symbol_database

1 个答案:

答案 0 :(得分:2)

可能是由于您安装的protobuf的版本不兼容。尝试通过以下方式升级protobuf:

sudo pip install --upgrade protobuf