update example code on TFF front page: dummy_batch was deprecated from from_keras_model()
@@ -69,10 +69,6 @@ landing_page:
# Pick a subset of client devices to participate in training.
train_data = [client_data(n) for n in range(3)]
- # Grab a single batch of data so that TFF knows what data looks like.
- sample_batch = tf.nest.map_structure(
- lambda x: x.numpy(), iter(train_data[0]).next())
-
# Wrap a Keras model for use with TFF.
def model_fn():
model = tf.keras.models.Sequential([
@@ -81,7 +77,7 @@ landing_page:
])
return tff.learning.from_keras_model(
model,
- dummy_batch=sample_batch,
+ input_spec=train_data[0].element_spec,
loss=tf.keras.losses.SparseCategoricalCrossentropy(),
metrics=[tf.keras.metrics.SparseCategoricalAccuracy()])
