安装tensorflow报错protobuf,解决方案

问题:

import tensorflow出的问题:

If this call came from a _pb2.py file, your generated code is out of d~

Downgrade the protobuf package to 3.20.x or lower.

解决方案:

方法一:

下载 1、下载 protobuf 并解压;

Release Protocol Buffers v3.19.0 · protocolbuffers/protobuf · GitHub

2、系统环境path添加

设置 PATH

当完成下面解压后,你可以将文件所在的 bin 目录中设置到 PATH 里面。

安装tensorflow报错protobuf,解决方案_第1张图片

3、终端cmd输入protoc --version 。

安装tensorflow报错protobuf,解决方案_第2张图片

方法二(推荐)

最简单的解决方法是:

 pip install protobuf==3.14.0 -i  https://pypi.douban.com/simple/

你可能感兴趣的:(问题解决,tensorflow,人工智能,python)