paddlepaddle安装问题protobuf package to 3.20.x or lower.

这篇具有很好参考价值的文章主要介绍了paddlepaddle安装问题protobuf package to 3.20.x or lower.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

按照官方文档安装paddlepaddle 2.3.0后,进行环境验证时,总是提示如下错误:

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

这说明我们使用的protobuf库的版本高了,可以卸载已经安装过的protobuf 版本,再安装3.20.x以下的版本,我们可以使用3.19.0版本即可,命令如下:

1、卸载protobuf 已经安装的版本
     

pip uninstall protobuf

Found existing installation: protobuf 4.21.1
Uninstalling protobuf-4.21.1:
  Would remove:
......
Proceed (Y/n)? y
  Successfully uninstalled protobuf-4.21.1

2、安装3.19.0版本

pip install protobuf==3.19.0

Installing collected packages: protobuf
Successfully installed protobuf-3.19.0

好了,再进行paddle环境的验证吧:

>>> import paddle
>>> paddle.utils.run_check()


Running verify PaddlePaddle program ...
PaddlePaddle works well on 1 CPU.
W0601 23:27:12.940966 28720 fuse_all_reduce_op_pass.cc:76] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 2.
PaddlePaddle works well on 2 CPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.文章来源地址https://www.toymoban.com/news/detail-656138.html

到了这里,关于paddlepaddle安装问题protobuf package to 3.20.x or lower.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包