b0a116e3fe579f1bbded4ac75382588b6d3fd381,imagenet/main.py,,main,#,56

Before Change


    normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

    train_loader = torch.utils.data.DataLoader(
        datasets.ImageFolder(traindir, transforms.Compose([
            transforms.RandomSizedCrop(224),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(),
            normalize,
        ])),
        batch_size=args.batch_size, shuffle=True,
        num_workers=args.workers, pin_memory=True)

    val_loader = torch.utils.data.DataLoader(
        datasets.ImageFolder(valdir, transforms.Compose([
            transforms.Scale(256),

After Change


    normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

    train_dataset = datasets.ImageFolder(
        traindir,
        transforms.Compose([
            transforms.RandomSizedCrop(224),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(),
            normalize,
        ]))

    if args.distributed:
        train_sampler = torch.utils.data.distributed.DistributedSampler(train_dataset)
    else:
        train_sampler = None

    train_loader = torch.utils.data.DataLoader(
        train_dataset, batch_size=args.batch_size, shuffle=(train_sampler is None),
        num_workers=args.workers, pin_memory=True, sampler=train_sampler)

    val_loader = torch.utils.data.DataLoader(
        datasets.ImageFolder(valdir, transforms.Compose([
            transforms.Scale(256),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: pytorch/examples
Commit Name: b0a116e3fe579f1bbded4ac75382588b6d3fd381
Time: 2017-07-28
Author: adam.paszke@gmail.com
File Name: imagenet/main.py
Class Name:
Method Name: main


Project Name: mapillary/inplace_abn
Commit Name: 398485ce7bb30487e500247ced67d491542328eb
Time: 2018-12-03
Author: researcher@mapillary.com
File Name: test_imagenet.py
Class Name:
Method Name: main


Project Name: mapillary/inplace_abn
Commit Name: 398485ce7bb30487e500247ced67d491542328eb
Time: 2018-12-03
Author: researcher@mapillary.com
File Name: train_imagenet.py
Class Name:
Method Name: main


Project Name: osmr/imgclsmob
Commit Name: 0341632083a8c9ca00c804066fee135eb2aa56bb
Time: 2019-04-15
Author: osemery@gmail.com
File Name: pytorch/imagenet1k.py
Class Name:
Method Name: get_train_data_loader