首页 > 解决方案 > 无法为 Conda 更新 Tensorflow

问题描述

我想将 Tensorflow 从 1.14 更新到 2.1.0,但我做不到。

在我用命令安装它之后

conda install -c anaconda tensorflow-gpu

print(tensorflow.version ) 告诉我我的版本是1.14.0

之后一样

conda 更新 tensorflow-gpu

即使

康达安装https://anaconda.org/anaconda/tensorflow-gpu/2.1.0/download/win-64/tensorflow-gpu-2.1.0-h0d30ee6_0.tar.bz2

我进入命令提示符:

Downloading and Extracting Packages
tensorflow-gpu-2.1.0 | ######################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

C:\Windows\system32>set "KERAS_BACKEND="

C:\Windows\system32>python C:\Anaconda3\etc\keras\load_config.py  1>temp.txt

C:\Windows\system32>set /p KERAS_BACKEND= 0<temp.txt

C:\Windows\system32>del temp.txt

C:\Windows\system32>python -c "import keras"  1>nul 2>&1

C:\Windows\system32>if errorlevel 1 (
ver  1>nul
 set "KERAS_BACKEND=theano"
 python -c "import keras"  1>nul 2>&1
)

但我还在 1.14.0

标签: python-3.xtensorflowconda

解决方案


您可以通过在 Anaconda Prompt 中键入此命令来更新 Tensorflow。

conda install -c conda-forge tensorflow=2.1.0

希望这有效!


推荐阅读