test_data = tff.python.simulation.datasets.ClientData.from_clients_and_tf_fn(
client_ids=test_client_ids,
serializable_dataset_fn=create_tf_dataset_for_client_fn
)
print(test_data)
After running the above code I have got the below error... module 'tensorflow_federated.python.simulation.datasets' has no attribute 'ClientData'
How I can solve it?
It depends on which version of Tensorflow Federated you are using. Based on your code, you maybe using
tensorflow_federated=0.20.0. For that, instead of usingtff.python.simulation.datasets.ClientData, usetff.simulation.datasets.ClientDataas follows:This should sort out the mentioned error. If you've already done it with another approach, Kindly share that.