AGNOS onnx issue:
comma@tici:/data/openpilot$ python3 -c 'import onnx; onnx.load("/data/openpilot/selfdrive/modeld/models/supercombo.onnx")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/pyenv/versions/3.8.10/lib/python3.8/site-packages/onnx/__init__.py", line 11, in <module>
from onnx.external_data_helper import load_external_data_for_model, write_external_data_tensors, convert_model_to_external_data
File "/usr/local/pyenv/versions/3.8.10/lib/python3.8/site-packages/onnx/external_data_helper.py", line 14, in <module>
from .onnx_pb import TensorProto, ModelProto
File "/usr/local/pyenv/versions/3.8.10/lib/python3.8/site-packages/onnx/onnx_pb.py", line 8, in <module>
from .onnx_ml_pb2 import * # noqa
File "/usr/local/pyenv/versions/3.8.10/lib/python3.8/site-packages/onnx/onnx_ml_pb2.py", line 33, in <module>
_descriptor.EnumValueDescriptor(
File "/usr/local/pyenv/versions/3.8.10/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 755, 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/2022-05-06#python-updates
Setting PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python does work, but we should fix if we can
bug