205df55987d9c62c13738bebc5ffe18b738f1c50,train_vidreid_xent.py,,main,#,35

Before Change



        for epoch in range(args.fixbase_epoch):
            start_train_time = time.time()
            train(epoch, model, criterion, optimizer_tmp, trainloader, use_gpu, freeze_bn=True)
            train_time += round(time.time() - start_train_time)

        del optimizer_tmp
        print("Now open all layers for training")

After Change


    optimizer = init_optimizer(model.parameters(), **optimizer_kwargs(args))
    scheduler = lr_scheduler.MultiStepLR(optimizer, milestones=args.stepsize, gamma=args.gamma)

    if args.fixbase_epoch > 0:
        if hasattr(model, "classifier") and isinstance(model.classifier, nn.Module):
            optimizer_tmp = init_optimizer(model.classifier.parameters(), **optimizer_kwargs(args))
        else:
            print("Warn: model has no attribute "classifier" and fixbase_epoch is reset to 0")
            args.fixbase_epoch = 0
        raise NotImplementedError

    if args.load_weights and check_isfile(args.load_weights):
        // load pretrained weights but ignore layers that don"t match in size
        checkpoint = torch.load(args.load_weights)
        pretrain_dict = checkpoint["state_dict"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


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


Project Name: horovod/horovod
Commit Name: f7a24e6860c202c4694a1dded0a5098edd6b4880
Time: 2019-02-07
Author: darrenyxhu@gmail.com
File Name: examples/mxnet_imagenet_resnet50.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 415be78cc0d1275a29d0ceda550d0d7a7a5224ea
Time: 2020-09-08
Author: amogkam@users.noreply.github.com
File Name: python/ray/util/sgd/torch/training_operator.py
Class Name: TrainingOperator
Method Name: train_epoch


Project Name: pyannote/pyannote-audio
Commit Name: 0cd793984ffa7f7bbedaafddb5ade7c11886a38a
Time: 2017-09-25
Author: bredin@limsi.fr
File Name: pyannote/audio/applications/feature_extraction.py
Class Name:
Method Name: extract