Liangqiong / ViT-FL-main

MIT License
103 stars 18 forks source link

About validation results of client #3

Closed Damon328 closed 1 year ago

Damon328 commented 2 years ago

Hello, Thanks for the interesting work!

Train Model:

python train_FedAVG.py --FL_platform ViT-FedAVG --net_name ViT-small --dataset cifar10 --E_epocmax_communication_rounds 100 --num_local_clients -1 --split_type split_3 --save_model_flag

Then , I find that every client has same Valid metric after first train and have tried many times in different ways with the same result. I'm not sure that is a normal result.

Calculate the model avg----
Update each client model parameters----
++++++ Running Validation of client train_1 ++++++
Valid Loss: 1.59348 Valid metric: 0.62360
The updated best metric of client train_1 0.6236
++++++ Running Validation of client train_1 ++++++
We also update the test acc of client train_1 as 0.628
++++++ Running Validation of client train_2 ++++++
Valid Loss: 1.59348 Valid metric: 0.62360
The updated best metric of client train_2 0.6236
++++++ Running Validation of client train_2 ++++++
We also update the test acc of client train_2 as 0.628
++++++ Running Validation of client train_3 ++++++
Valid Loss: 1.59348 Valid metric: 0.62360
The updated best metric of client train_3 0.6236
++++++ Running Validation of client train_3 ++++++
We also update the test acc of client train_3 as 0.628
++++++ Running Validation of client train_4 ++++++
Valid Loss: 1.59348 Valid metric: 0.62360
The updated best metric of client train_4 0.6236
++++++ Running Validation of client train_4 ++++++
We also update the test acc of client train_4 as 0.628
++++++ Running Validation of client train_5 ++++++
Valid Loss: 1.59348 Valid metric: 0.62360
The updated best metric of client train_5 0.6236
++++++ Running Validation of client train_5 ++++++
We also update the test acc of client train_5 as 0.628
train_FedAVG.py:140: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  args.record_val_acc = args.record_val_acc.append(args.current_acc, ignore_index=True)
train_FedAVG.py:142: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  args.record_test_acc = args.record_test_acc.append(args.current_test_acc, ignore_index=True)
train_FedAVG.py:147: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  tmp_round_acc = [val for val in args.current_test_acc.values() if not val == []]
Train the client train_1 of communication round 1

Thanks!

Liangqiong commented 2 years ago

If the vision transformer is applied as baseline, and if the validation dataset is a union validation dataset, then it is normal that the results of difference clients are the same. For Retina and Cifar-10, we use the union validation dataset, thus it is normal that each client has the same validation acc.