You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bump in protobuf version is not reflected in https://github.com/tensorflow/metadata/blob/master/setup.py#L139. As a result, pip might install an older version of protobuf (e.g. required by an older version of tensorflow) and the latest version of tensorflow-metadata, which results in an import time failure.
This will now install protobuf==5.29.6 (required by tensorflow==2.18.0) and lead to the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/test_meta/.venv/lib/python3.12/site-packages/tensorflow_metadata/proto/__init__.py", line 16, in <module>
from tensorflow_metadata.proto.v0 import (
File "/tmp/test_meta/.venv/lib/python3.12/site-packages/tensorflow_metadata/proto/v0/anomalies_pb2.py", line 12, in <module>
_runtime_version.ValidateProtobufRuntimeVersion(
File "/tmp/test_meta/.venv/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 100, in ValidateProtobufRuntimeVersion
_ReportVersionError(
File "/tmp/test_meta/.venv/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 50, in _ReportVersionError
raise VersionError(msg)
google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading tensorflow_metadata/proto/v0/anomalies.proto: gencode 6.31.1 runtime 5.29.6. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.
Activity
kho commentedon Jun 22, 2026
Copied here for better visibility:
(Regarding
_PROTOBUF_VERSION = "6.31.1"in WORKSPACE)Here's an example for reproducing the problem:
This will now install
protobuf==5.29.6(required bytensorflow==2.18.0) and lead to the following error: