简体   繁体   中英

How can I solve this error about TensorFlow environment?

I have met the error as follows when I run some code of TFF:

my code:

!pip install --quiet --upgrade tensorflow_federated

import collections
import numpy as np
import tensorflow as tf
import tensorflow_federated as tff

tf.compat.v1.enable_v2_behavior()

my Error:

ImportError: This version of TensorFlow Addons requires TensorFlow 
version >= 2.1.0; Detected an installation of version 1.15.0. Please upgrade 
TensorFlow to proceed.

My try:

I have tried to upgrade tensorflow to 2.1.0 but the same error appeared. And then I uninstall tensorflow and install it again, but there is no change with error output.

pip install --upgrade tensorflow

升级 TensorFlow 并重试

尝试这个

python -m pip install --upgrade tensorflow

I ran into the same issue this morning.

What fixed it for me was uninstalling then re installing both tensorflow and the tensorflow-addons package. Give that a try:

pip uninstall tensorflow-addons
pip uninstall tensorflow

pip install tensorflow
pip install tensorflow-addons

uninstall version

!pip uninstall tensorflow

install latest version

!pip install tensorflow==1.15.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM