Closed suololololo closed 1 year ago
Yep. I forgot to update the client/fedmd.py
when published the new feature about data transformation. I will fix the code now. Thank you for pointing it out.
https://github.com/KarhouTam/FL-bench/commit/74b14f48e0be39f3f2a14f55650f245c33dec29e
FedMD should work properly now.
Please pull the latest code and try again.
Thank you for your bug fix!
But after I pull the latest code and try python fedmd.py
command again. An error has occurred with the following error message:
Traceback (most recent call last):
File "/home/cjj/gitproject/FL-bench/src/server/fedmd.py", line 79, in
Maybe the default arg of model choice is not suitable. Or what command do I need to execute?
Since FedMD's paper only show two cases of [public dataset, private dataset]
. The default value of arg --public_dataset
of FedMD is mnist
, but the default arg of --dataset
(the private one) is cifar10
, which is not compatible.
If you wanna run the [mnist, femnist/emnist]
, you can run command like:
python fedmd.py -d emnist
For [cifar10, cifar100]
:
python fedmd.py --public_dataset cifar10 -d cifar100
Thank you for your answers!
the code of FedMD algorithmn not work. When I run the command:
An error has occurred with the following error message:
Traceback (most recent call last): File "/home/cjj/gitproject/FL-bench/src/server/fedmd.py", line 78, in
server = FedMDServer()
File "/home/cjj/gitproject/FL-bench/src/server/fedmd.py", line 39, in init
self.trainer = FedMDClient(
File "/home/cjj/gitproject/FL-bench/src/client/fedmd.py", line 24, in init
self.public_dataset = DATASETS[self.args.public_dataset](
TypeError: MNIST.init() got an unexpected keyword argument 'transform'
I think the bug maybe in the file src/client/fedmd.py of function FedMDClient.init()
My environment
Python 3.10.10
Experiment Arguments:
{
'model': 'lenet5',
'dataset': 'cifar10',
'seed': 42,
'join_ratio': 0.1,
'global_epoch': 100,
'local_epoch': 5,
'finetune_epoch': 0,
'test_gap': 100,
'eval_test': 1,
'eval_train': 0,
'local_lr': 0.01,
'momentum': 0.0,
'weight_decay': 0.0,
'verbose_gap': 100000,
'batch_size': 32,
'visible': 0,
'global_testset': 0,
'straggler_ratio': 0,
'straggler_min_local_epoch': 1,
'use_cuda': 1,
'save_log': 1,
'save_model': 0,
'save_fig': 1,
'save_metrics': 1,
'digest_epoch': 1,
'public_dataset': 'mnist',
'public_batch_size': 32,
'public_batch_num': 5,
'dataset_args': {'dataset': 'cifar10', 'client_num': 100, 'fraction': 0.5, 'seed': 42, 'split': 'sample', 'alpha': 0.1, 'least_samples': 40}
}