AttributeError:'模块'对象没有属性' MutableMapping'

时间:2015-12-14 20:45:59

标签: python ubuntu tensorflow

我按照说明在Ubuntu 14.04 g2.8xlarge aws实例上安装Google Tensorflow及其依赖项。在尝试运行示例问题时,我遇到了下面发布的错误。任何帮助将不胜感激。感谢。

Traceback (most recent call last):
  File "convolutional.py", line 30, in <module>
    import tensorflow.python.platform
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 37, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 50, in <module>
    from google.protobuf.pyext import _message
AttributeError: 'module' object has no attribute 'MutableMapping'

1 个答案:

答案 0 :(得分:5)

这听起来像是TensorFlow与您计算机上安装的协议缓冲区版本之间不兼容。两个最佳选择是:

  1. 尝试将/usr/local/lib/python2.7/dist-packages/google/protobuf/中的Protobuf库升级到3.0.0a3或更高版本。

  2. 按照说明here在virtualenv中安装TensorFlow。这应该与TensorFlow一起安装适当版本的protobuf。