Google Colab 中的 Tensorflow Federated 教程在初始化代码片段中出现错误 [英] Tensorflow Federated tutorial in Google Colab giving errors in the initialization code snippet

查看:59
本文介绍了Google Colab 中的 Tensorflow Federated 教程在初始化代码片段中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是在开始教程之前需要运行的单元格.

Here is the cell that needs to be run before starting the tutorial.

#@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 上的库和类不太熟悉.

Need help resolving this. I am not much familiar with libraries and classes on Tensorflow.

推荐答案

你可以像下面这样导入 tensorflow federated.它解决了我的错误.我尝试遵循图像分类的联邦学习,当我尝试导入 tensorflow_federated 时,它总是给我错误.

You can import tensorflow federated like the following. It solved my error. I tried to follow Federated Learning for Image Classification and while I was trying to import tensorflow_federated it was always giving me error.

from tensorflow_federated import python as tff

这篇关于Google Colab 中的 Tensorflow Federated 教程在初始化代码片段中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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