遇到“TypeError: 无法直接创建描述符”。在深度学习工作台 2022.1 中导入模型时
内容类型: 错误讯息 | 文章 ID: 000091282 | 上次审核日期: 2023 年 11 月 16 日
在 DL Workbench 2022.1 中转换模型时遇到错误:
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
据报道,protobuf 版本 4.21.0 破坏了包括 TensorFlow 库在内的多个库,需要限制为较低版本。