前提
Federated Learning for Image Classificationから
https://www.tensorflow.org/federated/tutorials/federated_learning_for_image_classification?hl=ja
Google Colabで実行をスタートさせたのですがエラーが発生いたします。
実現したいこと
Python
1import collections 2 3import dp_accounting 4import numpy as np 5import pandas as pd 6import tensorflow as tf 7import tensorflow_federated as tff
発生している問題・エラーメッセージ
Python
1 2--------------------------------------------------------------------------- 3TypeError Traceback (most recent call last) 4<ipython-input-2-b7774dff6eec> in <module> 5 5 import pandas as pd 6 6 import tensorflow as tf 7----> 7 import tensorflow_federated as tff 8 914 frames 10/usr/lib/python3.8/typing.py in _type_check(arg, msg, is_argument) 11 147 return arg 12 148 if not callable(arg): 13--> 149 raise TypeError(f"{msg} Got {arg!r:.100}.") 14 150 return arg 15 151 16 17TypeError: Callable[[arg, ...], result]: each arg must be a type. Got Ellipsis.
このようにエラーが返っていました。
Google Colabでなぜこのようなエラーが起こるのかわかりません。
お手数ですが、教えて頂けたら幸いです。
その前の「始める前に」は正常に終了するでしょうか。
こちらで試したところ「ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.」となりましたが。
can110さん
!pip install --quiet --upgrade tensorflow_federated
↓ 変更 (--quietを付けない)
!pip install --upgrade tensorflow_federated
としてから実行したら分かりますが、
> 「ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.」となりましたが。
の下に
「Successfully installed absl-py-1.0.0 attrs-21.4.0 cachetools-3.1.1 contourpy-1.0.7 dm-tree-0.1.7 dp-accounting-0.3.0 farmhashpy-0.4.0 fonttools-4.38.0 grpcio-1.46.5 matplotlib-3.6.3 pandas-1.5.3 portpicker-1.5.2 semantic-version-2.6.0 tensorflow-model-optimization-0.7.3 tensorflow-privacy-0.8.7 tensorflow-probability-0.15.0 tensorflow_federated-0.33.0」
と表示されるので、「tensorflow_federated」はインストールされるようです
もちろん、「This behaviour is the source of the following dependency conflicts.」の副作用で、変なことが起きる可能性はありますが
なるほど。
あと、たぶん同じ現象がつい最近報告されてますね。
Callable[[arg, ...], result]: each arg must be a type. Got Ellipsis. #3519
https://github.com/tensorflow/federated/issues/3519
最近Colabが20.04に変わった影響なのかなあ?
これです
https://github.com/googlecolab/colabtools/issues/3281
「The latest version of tensorflow-federated requires Python 3.9+.」
なるほど。tensorflow-federated側の更新が原因なのですね。
can110さん、jbpb0さん
教えて頂きありがとうございます!
本当に感謝です。

回答2件
あなたの回答
tips
プレビュー