Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Personalised FedReID #10

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open

Personalised FedReID #10

wants to merge 74 commits into from

Conversation

codergan
Copy link
Collaborator

support personalised clustering training for FedReID

@codergan codergan requested a review from weimingwill May 10, 2021 12:45
# inputs = Variable(inputs.cuda().detach())
# labels = Variable(labels.cuda().detach())
# else:
# inputs, labels = Variable(inputs), Variable(labels)
Copy link
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

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
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?

# 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
Member

Choose a reason for hiding this comment

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

Remove these comments

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
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

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

Choose a reason for hiding this comment

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

Remove these comments

if args.regularization:
reg = "reg"
else:
reg = "Nreg"
Copy link
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.

@@ -53,24 +54,87 @@
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
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?

@@ -0,0 +1,4 @@
export PYTHONPATH=$PYTHONPATH:$pwd
Copy link
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

import torch.optim as optim
from torchvision import datasets
# from finch import FINCH
Copy link
Member

Choose a reason for hiding this comment

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

remove comment

if epoch==0:
self.L0 = torch.Tensor(loss)

avg_loss = sum(loss) / self.num_of_clients

print("==============================")
print("number of clients used:", len(models))
# print("number of clients used:", len(models))
Copy link
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