Comments (3)
Thank you for the details! I have a hypothesis about this, looking into it now.
Just to clarify: The memory blowup happens if you do something like
sampled_clients = ... # Fix a set of clients
for _ in range(100):
client_data = [train_set.create_tf_dataset_for_client(x) for x in sampled_clients]
# Do some model training with client_data
Does it happen if you fix the client datasets across all rounds, e.g.:
sampled_clients = ... # Fix a set of clients
client_data = [train_set.create_tf_dataset_for_client(x) for x in sampled_clients]
for _ in range(100):
# Do some model training with client_data
from federated.
@christymarc I believe that 1ab31a2 should resolve your issue.
If you'd like to use it with an earlier TFF version, you should be able to do something like the following:
First, sub-class FilePerUserClientData
to avoid the issue fixed in 1ab31a2:
class StreamlinedFilePerUserClientData(tff.simulation.datasets.FilePerUserClientData):
def __init__(
self,
client_ids_to_files: Mapping[str, str],
dataset_fn: Callable[[str], tf.data.Dataset],
):
self._client_ids_to_files = client_ids_to_files
self._dataset_fn = dataset_fn
super().__init__(client_ids_to_files, dataset_fn)
def create_tf_dataset_for_client(self, client_id: str) -> tf.data.Dataset:
if client_id not in self.client_ids:
raise ValueError(
'ID [{i}] is not a client in this ClientData. See '
'property `client_ids` for the list of valid ids.'.format(i=client_id)
)
return self._dataset_fn(self._client_ids_to_files[client_id])
Then, to load flair, do the following as usual:
tff.simulation.datasets.flair.download_data(data_dir)
tff.simulation.datasets.flair.download_data(data_dir, cache_dir)
Then follow the load_data
code here but replace FilePerUserClientData
with StreamlinedFilePerUserClientData
from above.
Please let me know if that solves your problem.
from federated.
@christymarc All tests I've run so far suggest that this has been fixed by the aforementioned change. I'm marking this as resolved for now, but if you continue to hit this issue even with the change (or workaround above), please feel free to re-open.
from federated.
Related Issues (20)
- Implemented simulation tff code to be distribute from server to clients. HOT 2
- LearningProcess Compatibility Error HOT 2
- An error went when I ran pip install --upgrade tensorflow-federated HOT 2
- AttributeError: module 'tensorflow._api.v2.nest' has no attribute 'map_struture' HOT 1
- Documentation Issue - build_fed_kmeans HOT 1
- Error installing Tensorflow Federated with Python 3.9 HOT 4
- OperatorNotAllowedInGraphError Traceback (most recent call last)
- TFF using model resnet,the val accuracy has always been a result of random guessing
- AttributeError: module 'numpy' has no attribute '_no_nep50_warning' when importing TensorFlow Federated HOT 6
- Installation failed HOT 10
- Facing error in "Learning Attribute" Please Help. HOT 2
- tff.federated_computation(lambda: 'Hello World!')() stuck/hanging HOT 6
- Stuck at learning_process.initialize() and tff.federated_computation(lambda: 'Hello, World!')() HOT 1
- Security policy for tensorflow federated?
- Colab stuck at learning_process.initialize() HOT 14
- No GPU utilization when using the cpp execution context HOT 1
- perform cross-silo federated learning by TFF HOT 2
- Installtion failed HOT 5
- Keras 3 and TF 16.1 support HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from federated.