Skip to content

Personalised FedReID#10

Open
codergan wants to merge 74 commits into
cap-ntu:masterfrom
codergan:master
Open

Personalised FedReID#10
codergan wants to merge 74 commits into
cap-ntu:masterfrom
codergan:master

Conversation

@codergan
Copy link
Copy Markdown
Collaborator

support personalised clustering training for FedReID

@codergan codergan requested a review from weimingwill May 10, 2021 12:45
Comment thread client.py
# inputs = Variable(inputs.cuda().detach())
# labels = Variable(labels.cuda().detach())
# else:
# inputs, labels = Variable(inputs), Variable(labels)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can just remove these comments

Comment thread client.py
self.model.train(True)
optimizer = get_optimizer(self.model, self.lr)
scheduler = lr_scheduler.StepLR(optimizer, step_size=40, gamma=0.1)
# scheduler = lr_scheduler.StepLR(optimizer, step_size=40, gamma=0.1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we don't need the scheduler anymore?

Comment thread evaluate.py
# parser = argparse.ArgumentParser(description='Training')
# parser.add_argument('--result_dir', default='.', type=str)
# parser.add_argument('--dataset', default='no_dataset', type=str)
# args = parser.parse_args()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments

Comment thread evaluate.py
gallery_label = np.array(result['gallery_label'])
# print(type(query_feature),query_feature[:3])
# print(type(query_cam),query_cam[:3])
# print(type(query_label),query_label[:3])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these debugging prints

Comment thread evaluate.py
# result = scipy.io.loadmat(file_path)
# print("========= after loading ==========")
# for i in result:
# print(i, np.array(result[i]).shape)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments

Comment thread main.py
if args.regularization:
reg = "reg"
else:
reg = "Nreg"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these if else from line 95 - 110 only for setting the name for the checkpoint? It would be better to put them into a function.

Comment thread main.py
parser.add_argument('--multiple_scale',default='1', type=str,help='multiple_scale: e.g. 1 1,1.1 1,1.1,1.2')
parser.add_argument('--test_dir',default='all',type=str, help='./test_data')

parser.add_argument('--resume_epoch', default=0, type=int, help='resume from which epoch, if 0, no resume')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be resume round?

Comment thread running.sh
@@ -0,0 +1,4 @@
export PYTHONPATH=$PYTHONPATH:$pwd
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put all these scripts for running into a separate folder script

Comment thread server.py
import random
import torch.optim as optim
from torchvision import datasets
# from finch import FINCH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Comment thread server.py

print("==============================")
print("number of clients used:", len(models))
# print("number of clients used:", len(models))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants