fce777938160f7aa5e8ed3702ce93c5a1c3760bc,train_vidreid_xent_htri.py,,main,#,100

Before Change



    if args.load_weights:
        // load pretrained weights but ignore layers that don"t match in size
        print("Loading pretrained weights from "{}"".format(args.load_weights))
        checkpoint = torch.load(args.load_weights)
        pretrain_dict = checkpoint["state_dict"]
        model_dict = model.state_dict()
        pretrain_dict = {k: v for k, v in pretrain_dict.items() if k in model_dict and model_dict[k].size() == v.size()}
        model_dict.update(pretrain_dict)
        model.load_state_dict(model_dict)

    if args.resume:
        if osp.isfile(args.resume):
            checkpoint = torch.load(args.resume)
            model.load_state_dict(checkpoint["state_dict"])
            args.start_epoch = checkpoint["epoch"]
            rank1 = checkpoint["rank1"]
            print("Loaded checkpoint from "{}"".format(args.resume))
            print("- start_epoch: {}\n- rank1: {}".format(args.start_epoch, rank1))
        else:
            print("=> No checkpoint found at "{}"".format(args.resume))

    if use_gpu:
        model = nn.DataParallel(model).cuda()

After Change



    if args.load_weights:
        // load pretrained weights but ignore layers that don"t match in size
        if check_isfile(args.load_weights):
            checkpoint = torch.load(args.load_weights)
            pretrain_dict = checkpoint["state_dict"]
            model_dict = model.state_dict()
            pretrain_dict = {k: v for k, v in pretrain_dict.items() if k in model_dict and model_dict[k].size() == v.size()}
            model_dict.update(pretrain_dict)
            model.load_state_dict(model_dict)
            print("Loaded pretrained weights from "{}"".format(args.load_weights))

    if args.resume:
        if check_isfile(args.resume):
            checkpoint = torch.load(args.resume)
            model.load_state_dict(checkpoint["state_dict"])
            args.start_epoch = checkpoint["epoch"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 17

Instances


Project Name: KaiyangZhou/deep-person-reid
Commit Name: fce777938160f7aa5e8ed3702ce93c5a1c3760bc
Time: 2018-08-07
Author: k.zhou@qmul.ac.uk
File Name: train_vidreid_xent_htri.py
Class Name:
Method Name: main


Project Name: KaiyangZhou/deep-person-reid
Commit Name: fce777938160f7aa5e8ed3702ce93c5a1c3760bc
Time: 2018-08-07
Author: k.zhou@qmul.ac.uk
File Name: train_imgreid_xent.py
Class Name:
Method Name: main


Project Name: KaiyangZhou/deep-person-reid
Commit Name: fce777938160f7aa5e8ed3702ce93c5a1c3760bc
Time: 2018-08-07
Author: k.zhou@qmul.ac.uk
File Name: train_vidreid_xent.py
Class Name:
Method Name: main


Project Name: KaiyangZhou/deep-person-reid
Commit Name: fce777938160f7aa5e8ed3702ce93c5a1c3760bc
Time: 2018-08-07
Author: k.zhou@qmul.ac.uk
File Name: train_imgreid_xent_htri.py
Class Name:
Method Name: main