I am building a federated learning model.
I have written the code below, but I keep getting the error, which is also not true
please let me know how to use the function train_test_client_split properly?
@tf.function
def create_tf_dataset_for_client_fn(dataset_path):
return tf.data.experimental.CsvDataset(
dataset_path, record_defaults=record_defaults, header=True )
source = tff.simulation.datasets.FilePerUserClientData(
dataset_paths, create_tf_dataset_for_client_fn)
print(source.client_ids)
>> ['client_0', 'client_1', 'client_2']
@classmethod
def from_clients_and_fn():
client_ids: Iterable[str]
create_tf_dataset_for_client_fn: Callable[[str], tf.data.Dataset]
Splitting=source.from_clients_and_tf_fn(['client_0', 'client_1', 'client_2'],create_tf_dataset_for_client_fn)
source.train_test_client_split(client_data=Splitting,
num_test_clients=1)
NotFoundError: client_1; No such file or directory [Op:IteratorGetNext]
The file is there and the path is correct, but I don't know what it the problem here?