-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: master
Are you sure you want to change the base?
Conversation
# inputs = Variable(inputs.cuda().detach()) | ||
# labels = Variable(labels.cuda().detach()) | ||
# else: | ||
# inputs, labels = Variable(inputs), Variable(labels) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment
support personalised clustering training for FedReID