简体   繁体   English

Tensorflow 联合学习在 colab 中出现错误

[英]Tensorflow federated-learning giving error in colab

I am trying to run the Tensorflow federated tutorial on colab ( https://colab.research.google.com/github/tensorflow/federated/blob/v0.5.0/docs/tutorials/federated_learning_for_image_classification.ipynb#scrollTo=coAumH42q9nz )我正在尝试在 colab 上运行 Tensorflow 联合教程( https://colab.research.google.com/github/tensorflow/federated/blob/v0.5.0/docs/tutorials/federated_learning_for_image_classification.ipynb#scrollTo=coAumH42q9nz

However, so far, the from tensorflow_federated import python as tff code is giving the following error:但是,到目前为止, from tensorflow_federated import python as tff代码给出了以下错误:

Any suggestion would be greatly appreciated.任何建议将不胜感激。 Thanks for your time.谢谢你的时间。


TypeError                                 Traceback (most recent call last)
<ipython-input-3-af7e4c5121d6> in <module>()
      1 import tensorflow as tf
----> 2 from tensorflow_federated import python as tff

6 frames
/usr/local/lib/python3.7/dist-packages/tensorflow_federated/python/common_libs/structure.py in <module>()
    263 
    264 def to_odict(struct: Struct,
--> 265              recursive: bool = False) -> collections.OrderedDict[str, Any]:
    266   """Returns `struct` as an `OrderedDict`, if possible.
    267 

TypeError: 'type' object is not subscriptable

TFF's recent releases have been compatible only with Python 3.9 and later; TFF 的最新版本仅与 Python 3.9 及更高版本兼容; Google Colab's hosted runtimes are still on Python 3.7. Google Colab 的托管运行时仍在 Python 3.7 上。

Likely the quickest way to run these notebooks is to run your own local runtime using Python 3.9, and connect the notebooks there;运行这些笔记本的最快方法可能是使用 Python 3.9 运行您自己的本地运行时,然后将笔记本连接到那里; instructions on doing this from Colab can be found here .可在此处找到 Colab 执行此操作的说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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