栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

安装onnx遇到error信息:Couldn‘t build proto file

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安装onnx遇到error信息:Couldn‘t build proto file

安装完onnx和onnxsim后,import时提示如下错误信息等:

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).

TypeError: Couldn’t build proto file into descriptor pool: duplicate file name (onnx/onnx-ml.proto)

从提示中可以看出和protobuf相关。
解决方案:

pip uninstall protobuf
pip install --no-binary protobuf protobuf

参考:
https://stackoverflow.com/questions/68952308/tensorflow-couldnt-build-proto-file-into-descriptor-pool
https://blog.csdn.net/bailu1016/article/details/115002705

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/977351.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号