iterative_process = tff.learning.algorithms.build_unweighted_fed_prox(
model_fn,
proximal_strength= 0.5,
client_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=0.01),
server_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=1.0))
state, metrics = iterative_process.next(state, federated_train_data)
print('round 1, metrics={}'.format(metrics))
On executing the round 1, it throws (TypeError: cannot unpack non-iterable LearningProcessOutput object).
It was working fine when we use Fedavg, but not with fedprox
iterative_process.next
returnsLearningProcessOutput
which is not iterable, as the error says.You can replace it by
or just use the
output
directly.