Attempting to run federated learning on tff however, encountering the following:
AttributeError: module 'tensorflow_federated.python.learning' has no attribute 'from_keras_model'
Code: trainer = tff.learning.algorithms.build_weighted_fed_avg( model_fn, client_optimizer_fn=lambda: tf.keras.optimizers.Adam(), server_optimizer_fn=lambda: tf.keras.optimizers.Adam() )
state = trainer.initialize() train_hist = [] for i in range(EPOCHS): state, metrics = trainer.next(state, train_data) train_hist.append(metrics)
print(f"\rRun {i+1}/{EPOCHS}", end="")
Environment: Using Google collab python - 3.10.12 TensorFlow Federated version: 0.61.0
Any help appreciated.
Attempted to downgrade version of TFF