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.

  • 21
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值