【问题标题】:KeyError: "Couldn't find field google.protobuf.DescriptorProto.ExtensionRange.options"KeyError:“找不到字段 google.protobuf.DescriptorProto.ExtensionRange.options”
【发布时间】:2018-04-25 17:55:38
【问题描述】:

我应该如何解决这个错误?

Mon Nov 13 00:37:49 :~$  /Users/mona/anaconda/bin/pip  install --upgrade tensorflow tensorflow-tensorboard
Collecting tensorflow
  Downloading tensorflow-1.4.0-cp36-cp36m-macosx_10_11_x86_64.whl (39.3MB)
    100% |████████████████████████████████| 39.3MB 28kB/s
Collecting tensorflow-tensorboard
  Downloading tensorflow_tensorboard-0.1.8-py3-none-any.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 560kB/s
Collecting wheel>=0.26 (from tensorflow)
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 604kB/s
Collecting protobuf>=3.3.0 (from tensorflow)
  Downloading protobuf-3.4.0-py2.py3-none-any.whl (375kB)
    100% |████████████████████████████████| 378kB 57kB/s
Collecting numpy>=1.12.1 (from tensorflow)
  Downloading numpy-1.13.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB)
    100% |████████████████████████████████| 4.6MB 200kB/s
Collecting enum34>=1.1.6 (from tensorflow)
  Downloading enum34-1.1.6-py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow)
  Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already up-to-date: werkzeug>=0.11.10 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: bleach==1.5.0 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: markdown>=2.6.8 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: html5lib==0.9999999 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
  Downloading setuptools-36.7.1-py2.py3-none-any.whl (482kB)
    100% |████████████████████████████████| 491kB 883kB/s
Installing collected packages: wheel, six, setuptools, protobuf, numpy, tensorflow-tensorboard, enum34, tensorflow
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
      Successfully uninstalled wheel-0.29.0
  Found existing installation: six 1.10.0
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Found existing installation: setuptools 36.5.0.post20170921
    Uninstalling setuptools-36.5.0.post20170921:
      Successfully uninstalled setuptools-36.5.0.post20170921
  Found existing installation: protobuf 3.3.2
    Uninstalling protobuf-3.3.2:
      Successfully uninstalled protobuf-3.3.2
  Found existing installation: numpy 1.12.1
    Uninstalling numpy-1.12.1:
      Successfully uninstalled numpy-1.12.1
  Found existing installation: tensorflow 1.1.0
    Uninstalling tensorflow-1.1.0:
      Successfully uninstalled tensorflow-1.1.0
Successfully installed enum34-1.1.6 numpy-1.13.3 protobuf-3.4.0 setuptools-36.7.1 six-1.11.0 tensorflow-1.4.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0
Mon Nov 13 00:40:10 :~$ tensorboard --logdir=/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/tmpzy0cj6xc
Traceback (most recent call last):
  File "/Users/mona/anaconda/bin/tensorboard", line 7, in <module>
    from tensorboard.main import main
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorboard/main.py", line 29, in <module>
    import tensorflow as tf
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/core/framework/graph_pb2.py", line 10, in <module>
    from google.protobuf import descriptor_pb2
  File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor_pb2.py", line 409, in <module>
    options=None),
  File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 501, in __new__
    return _message.default_pool.FindFieldByName(full_name)
KeyError: "Couldn't find field google.protobuf.DescriptorProto.ExtensionRange.options"
Mon Nov 13 00:40:22 :~$

【问题讨论】:

    标签: python tensorflow anaconda conda tensorboard


    【解决方案1】:

    可以在here 找到有关 Google protobuf 的相关错误报告,您可能想查看它。 GitHub tensorflow here 上有一个错误报告。解决方案可能是运行

    pip install tensorflow tensorflow-tensorboard --upgrade --force-reinstall
    

    你可以试试吗?

    【讨论】:

      【解决方案2】:

      你可以试试这个食谱:

      pip uninstall tensorflow
      pip install tensorflow
      pip uninstall protobuf
      pip install protobuf==3.3.0.
      

      它对我有用。

      【讨论】:

        猜你喜欢
        • 2017-02-01
        • 2018-11-10
        • 2017-05-21
        • 2019-11-15
        • 2020-11-13
        • 2017-03-15
        • 2020-04-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多