我在https://colab.research.google.com/github/tensorflow/federated/blob/v0.13.1/docs/tutorials/federated_learning_for_image_classification.ipynb上运行了 tensorflow 联合教程代码。我收到了这个错误
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-17-d5336a451ad0> in <module>()
2 model_fn,
3 client_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=0.02),
----> 4 server_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=1.0))
2 frames
<ipython-input-16-7b97120f96c2> in model_fn()
7 dummy_batch=sample_batch,
8 loss=tf.keras.losses.SparseCategoricalCrossentropy(),
----> 9 metrics=[tf.keras.metrics.SparseCategoricalAccuracy()])
TypeError: from_keras_model() got an unexpected keyword argument 'dummy_batch'
提供的笔记本更新tensorflow_federated
到最新版本,因此 tff 版本为 0.14.0。那么在 0.14.0 版本中,我们不再需要喂 dummy batch 了吗?通常的 tff 工作管道是否发生了变化?
PS 降级tensorflow_federated
到 0.13.1 版有效。