以下是开始本教程之前需要运行的单元格
#@test {"skip": true}
# tensorflow_federated_nightly also bring in tf_nightly, which
# can causes a duplicate tensorboard install, leading to errors.
!pip uninstall --yes tensorboard tb-nightly
!pip install --quiet --upgrade tensorflow_federated_nightly
!pip install --quiet --upgrade nest_asyncio
!pip install --quiet tb-nightly # or tensorboard, but not both
import nest_asyncio
nest_asyncio.apply()
它给出了以下错误:
ERROR: tensorflow 2.4.1 requires tensorboard~=2.4, which is not installed.
ERROR: tensorflow 2.4.1 has requirement gast==0.3.3, but you'll have gast 0.4.0 which is incompatible.
ERROR: tensorflow 2.4.1 has requirement grpcio~=1.32.0, but you'll have grpcio 1.34.1 which is incompatible.
ERROR: tensorflow 2.4.1 has requirement h5py~=2.10.0, but you'll have h5py 3.1.0 which is incompatible.
ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.
需要帮助解决这个问题。我对Tensorflow上的库和类不太熟悉
您可以像下面这样导入tensorflow联邦。它解决了我的错误。我尝试使用联邦学习进行图像分类,当我尝试导入tensorflow_Federated时,它总是给我错误
即使控制台说有错误,pip包也应该正确安装
这是因为笔记本使用
tensorflow-federated-nightly
,这取决于安装tf-nightly
覆盖基本tensorflow
安装。但是pip
仍然认为TFF依赖项将与现在被覆盖的TensorFlow核心包冲突将
tensorflow
添加到!pip uninstall
列表可能会消除此错误,但笔记本的功能不会改变相关问题 更多 >
编程相关推荐