Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow 1.15 CI error #1209

Closed
albertz opened this issue Nov 10, 2022 · 2 comments
Closed

TensorFlow 1.15 CI error #1209

albertz opened this issue Nov 10, 2022 · 2 comments

Comments

@albertz
Copy link
Member

albertz commented Nov 10, 2022

...
Collecting protobuf>=3.6.1
  Downloading protobuf-4.21.9-cp37-abi3-manylinux2014_x86_64.whl (408 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 408.4/408.4 kB 87.0 MB/s eta 0:00:00
Requirement already satisfied: h5py in /home/runner/.local/lib/python3.7/site-packages (from keras-applications>=1.0.8->tensorflow==1.15.3) (3.7.0)
Collecting markdown>=2.6.8
  Downloading Markdown-3.4.1-py3-none-any.whl (93 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.3/93.3 kB 34.9 MB/s eta 0:00:00
Collecting werkzeug>=0.11.15
  Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 232.7/232.7 kB 63.7 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=41.0.0 in /home/runner/.local/lib/python3.7/site-packages (from tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.3) (65.5.1)
Requirement already satisfied: importlib-metadata>=4.4 in /home/runner/.local/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.3) (5.0.0)
Collecting MarkupSafe>=2.1.1
  Downloading MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Requirement already satisfied: typing-extensions>=3.6.4 in /home/runner/.local/lib/python3.7/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.3) (4.4.0)
Requirement already satisfied: zipp>=0.5 in /home/runner/.local/lib/python3.7/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.3) (3.10.0)
Building wheels for collected packages: gast
  Building wheel for gast (setup.py): started
  Building wheel for gast (setup.py): finished with status 'done'
  Created wheel for gast: filename=gast-0.2.2-py3-none-any.whl size=7537 sha256=2572272d2b77ff5dba44a996df76f95664b74ff5cea0a5abcb3c833a37fa60aa
  Stored in directory: /home/runner/.cache/pip/wheels/cf/87/6f/3f34218ef184368cec9ee65bdfd65baf117811f0a0ce1263ff
Successfully built gast
Installing collected packages: tensorflow-estimator, wrapt, termcolor, six, protobuf, opt-einsum, MarkupSafe, gast, astor, absl-py, werkzeug, markdown, keras-preprocessing, keras-applications, grpcio, google-pasta, tensorboard, tensorflow
Successfully installed MarkupSafe-2.1.1 absl-py-1.3.0 astor-0.8.1 gast-0.2.2 google-pasta-0.2.0 grpcio-1.50.0 keras-applications-1.0.8 keras-preprocessing-1.1.2 markdown-3.4.1 opt-einsum-3.3.0 protobuf-4.21.9 six-1.16.0 tensorboard-1.15.0 tensorflow-1.15.3 tensorflow-estimator-1.15.1 termcolor-2.1.0 werkzeug-2.2.2 wrapt-1.14.1

Then:
While importing TensorFlow:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 102, in <module>
    from tensorflow_core import *
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/graph_pb2.py", line 16, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/node_def_pb2.py", line 16, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/attr_value_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/tensor_pb2.py", line 16, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/resource_handle_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
  File "/home/runner/.local/lib/python3.7/site-packages/tensorflow_core/core/framework/tensor_shape_pb2.py", line 42, in <module>
    serialized_options=None, file=DESCRIPTOR),
  File "/home/runner/.local/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/20[22](https://github.com/rwth-i6/returnn/actions/runs/3440254625/jobs/5738513821#step:7:23)-05-06#python-updates

Via

@albertz
Copy link
Member Author

albertz commented Nov 10, 2022

Related:
https://stackoverflow.com/questions/72441758/typeerror-descriptors-cannot-not-be-created-directly
protocolbuffers/protobuf#10051

Actually seems to be exactly the same:
protocolbuffers/protobuf#10051 (comment)

Solution seems to be to just use protobuf==3.20.1 in this case.

albertz added a commit that referenced this issue Nov 10, 2022
albertz added a commit that referenced this issue Nov 10, 2022
@albertz
Copy link
Member Author

albertz commented Nov 10, 2022

Ok, fixed now.

pip install --user "protobuf<=3.20.1"

For all older TF versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant