tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

ImportError: cannot import name 'runtime_version' from 'google.protobuf'

Open abique opened this issue 1 month ago • 0 comments

Running the following command fails:

python -m venv venv
venv/bin/pip install git+https://github.com/onnx/tensorflow-onnx
venv/bin/python -m tf2onnx.convert --tflite x.tflite --output x.onnx

Produces the following error:

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/tf2onnx/__init__.py", line 8, in <module>
    import onnx
  File "/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/onnx/__init__.py", line 78, in <module>
    from onnx.external_data_helper import (
    ...<3 lines>...
    )
  File "/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/onnx/external_data_helper.py", line 14, in <module>
    from onnx.onnx_pb import (
    ...<5 lines>...
    )
  File "/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/onnx/onnx_pb.py", line 4, in <module>
    from .onnx_ml_pb2 import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/onnx/onnx_ml_pb2.py", line 9, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (/home/abique/develop/bitwig/fixes1/float/transient-detector/build/venv/lib/python3.13/site-packages/google/protobuf/__init__.py)

abique avatar Nov 20 '25 11:11 abique