Comments (3)
Hello!
Thank you for bringing this to our attention. It appears that the tutorial could indeed be slightly outdated. To align with the current state of the codebase, the correct implementation of the function should be like this:
def call_my_data(config, client_config=None):
pass
Please note that if you encounter any issues while implementing the function, feel free to ask for further clarification.
Additionally, if you come across any other content in the tutorials that seems out of date, do let us know so that we can update the information accordingly.
Thank you for your contribution!
from federatedscope.
Thank you for bringing this to our attention. It appears that the tutorial could indeed be slightly outdated. To align with the current state of the codebase, the correct implementation of the function should be like this:
Thank you for your answer, but I have a new problem after changing the code, the new problem is as follows:
The complete code is below:
from torchvision.datasets import MNIST
from torchvision.transforms import transforms
from federatedscope.core.data import BaseDataTranslator
from federatedscope.register import register_data
def load_my_data(config, client_cfgs=None):
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=[0.1307], std=[0.3081])
])
data_train = MNIST(root='data', train=True, transform=transform, download=True)
data_test = MNIST(root='data', train=False, transform=transform, download=True)
translator = BaseDataTranslator(config, client_cfgs)
fs_data = translator([data_train, [], data_test])
return fs_data, config
def call_my_data(config, client_config=None):
pass
register_data("mydata", call_my_data)
I changed the value of data.type
in the scripts.example_configs.femnist.yaml
file to mydata
and ran federatedscope.main.py
with this config file.
from federatedscope.
The pass
in my past answer is code omitted for brevity, and you should implement it like this:
# ... [code omitted for brevity]
def call_my_data(config, client_config=None):
if config.data.type == "mydata":
data, modified_config = load_my_data(config)
return data, modified_config
# ... [code omitted for brevity]
from federatedscope.
Related Issues (20)
- some question about secret sharing HOT 4
- ConfigSpace Object has no attribute to .item() HOT 3
- Customize metric in LLM finetuning HOT 2
- Custom dataset for graph level prediction HOT 2
- Pytorch model saving HOT 1
- Question about LLaMA based federated training HOT 7
- Hello, I would like to ask how to use the final 'feature_importance' value inside the 'federatedscope.vertical_fl.tree_based_models.trainer.feature_order_protected_trainer.py' file? HOT 1
- the issue of introducing a new package HOT 1
- Issue in DistributedRunner
- save client's model HOT 3
- In LLM, where is the adapter for clients and servers to interact? HOT 3
- Offsite tuning code with multigpu setting throws error HOT 3
- Smaller test/val loss but lower evaluation accuracy HOT 3
- How to use multi GPU to finetune Llama2 HOT 2
- Unable to run demo in hyperparameter optimization HOT 2
- Server global evaluation total number HOT 1
- Error with 4 bit quantized LLM HOT 3
- TypeError: call_file_data() missing 1 required positional argument: 'client_cfgs' HOT 6
- Some questions about Backdoor Bench HOT 2
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 federatedscope.