Python datasets.__dict__() Examples

The following are 2 code examples of datasets.__dict__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module datasets , or try the search function .
Example #1
Source File: main.py    From two-stream-pytorch with MIT License 5 votes vote down vote up
def build_model():

    model_name = args.modality + "_" + args.arch
    model = models.__dict__[model_name](pretrained=True, num_classes=101)
    if args.arch.startswith('alexnet') or args.arch.startswith('vgg'):
        model.features = torch.nn.DataParallel(model.features)
        model.cuda()
    else:
        model = torch.nn.DataParallel(model).cuda()
    return model 
Example #2
Source File: main_single_gpu.py    From two-stream-pytorch with MIT License 5 votes vote down vote up
def build_model():

    model = models.__dict__[args.arch](pretrained=True, num_classes=101)
    model.cuda()
    return model