错误"Keras需要TensorFlow 2.2或更高版本". [英] Error "Keras requires TensorFlow 2.2 or higher"

查看:1272
本文介绍了错误"Keras需要TensorFlow 2.2或更高版本".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Visual Studio 2019和Tensorflow,但是由于出现以下错误消息,所以无法导入Keras:

I just installed Visual Studio 2019 and Tensorflow, but I cannot import Keras because I get the following error message:

Keras需要TensorFlow 2.2或更高版本.通过pip install tensorflow

问题是我除了安装Tensorflow 1.15外别无选择,因为我有以下设置:

The problem is that I had no choice but to install Tensorflow 1.15, because I have the following setup:

  • Visual Studio 2019
  • Python 3.7
  • CPU i7 920(无avs,仅SSE)
  • OS Windows 7 64
  • Nvidia GPU
  • CUDA 10.1

我必须下载并安装该Python版本,我的CPU和那个名为"tensorflow-1.15.0-cp37-cp37m-win_amd64"的CUDA版本的轮子.

I had to download and install a wheel for that Python version, my CPU, and that CUDA version named "tensorflow-1.15.0-cp37-cp37m-win_amd64".

Tensorflow似乎可以正常工作(它检测到我的GPU并显示"hello world"消息),但问题是Visual Studio安装了最新版本的Keras.

Tensorflow seems to work (it detects my GPU and prints a "hello world" message) but the problem is that Visual Studio installs the newest version of Keras.

如何指定较旧的兼容版本,以及较新的版本兼容?

How can I specify an older, compatible version, and what is the newer version compatible?

推荐答案

我上次发布keras时也遇到了同样的问题,我记得did():

I had the same issue caused by last keras release,what i remember did():

1-升级张量流:

  pip install --user --upgrade tensorflow-gpu

(可能缺少一些软件包,只需点子安装即可)

(there might be some missing packages, just pip install them)

2-升级Tensorboard

2-Upgrade Tensorboard

pip install --user --upgrade tensorboard

(可能缺少一些软件包,只需点子安装即可)

(there might be some missing packages, just pip install them)

3-降级Keras

3-Downgrade Keras

pip install keras==2.3.1

(适用于我的最新版本)

(latest version working for me)

4-降级tensorflow-gpu

4-Downgrade tensorflow-gpu

pip install --user --upgrade tensorflow-gpu==1.14.0

(适用于我的最新版本)

(latest version working for me)

让我知道是否有效!

Anaconda 2020.02

Anaconda 2020.02

Python 3.7

Python 3.7

CPU i3 8100

CPU i3 8100

OS Windows 10 64

OS Windows 10 64

Nvidia GPU GTX1050TI

Nvidia GPU GTX1050TI

CUDA 10.1

CUDA 10.1

这篇关于错误"Keras需要TensorFlow 2.2或更高版本".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆