rui-yan / SSL-FL

Self-supervised federated learning for medical imaging - IEEE TMI
63 stars 9 forks source link

error while training #6

Closed chillum-codeX closed 1 year ago

chillum-codeX commented 1 year ago

pytorch 1.7.1 cuda 11.0 card RTX 5000 supported

Traceback (most recent call last): File "run_beit_pretrain_FedAvg.py", line 347, in main(opts, model) File "run_beit_pretrain_FedAvg.py", line 193, in main wd_scheduler_all, loss_scaler_all = Partial_Client_Selection(args, model) File "/home/SSL-FL/code/util/FedAvg_utils.py", line 158, in Partial_Client_Selection model_all[proxy_single_client] = torch.nn.parallel.DistributedDataParallel(model_all[proxy_single_client], device_ids=[args.gpu], find_unused_parameters=True) AttributeError: 'Namespace' object has no attribute 'gpu'

rui-yan commented 1 year ago

If you previously trained the model on a single GPU, you might have encountered this error. However, it should now be resolved. Please replace your current FedAvg_utils.py file with the latest version located at SSL-FL/code/util/FedAvg_utils.py.