1

根据Github 上的本指南,我第一次将 ONNX 与 YOLO 结合使用。 每次我尝试运行一段导入 ONNX 的代码时,都会出现以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/onnx/__init__.py", line 8, in <module>
    from onnx.external_data_helper import load_external_data_for_model, write_external_data_tensors
  File "/usr/local/lib/python3.6/dist-packages/onnx/external_data_helper.py", line 10, in <module>
    from .onnx_pb import TensorProto, ModelProto
  File "/usr/local/lib/python3.6/dist-packages/onnx/onnx_pb.py", line 8, in <module>
    from .onnx_pb2 import *  # noqa
  File "/usr/local/lib/python3.6/dist-packages/onnx/onnx_pb2.py", line 7, in <module>
    from google.protobuf.internal import enum_type_wrapper

(我搞砸了复制回溯,但错误是导入错误:无法导入名称'enum_type_wrapper'或类似的东西)

据我所知,某些依赖项或版本存在问题,但是当我尝试重新安装 onnx 时,我发现所有必要的依赖项都已安装。

Requirement already satisfied: onnx in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: protobuf in /usr/local/lib/python3.6/dist-packages/protobuf-3.8.0-py3.6-linux-aarch64.egg (from onnx)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from onnx)
Requirement already satisfied: six in /home/msc-xavier/.local/lib/python3.6/site-packages (from onnx)
Requirement already satisfied: typing>=3.6.4 in /usr/local/lib/python3.6/dist-packages (from onnx)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.6/dist-packages (from onnx)
Requirement already satisfied: setuptools in /home/msc-xavier/.local/lib/python3.6/site-packages (from protobuf->onnx)

我搜索了整个 Github 和 stackoverflow,没有其他用户遇到同样的错误。我已经确保我使用的是最新的库和 Python (3.6.9) 并且 pip 已更新,但这似乎都不是问题。我很感激这里的一些指导。

4

0 回答 0