data_loader = torch.utils.data.DataLoader(
        test_data,
        batch_size=opt.batch_size,
        shuffle=True,
        num_workers=opt.n_threads,
        pin_memory=True)
    test.test(data_loader, model, opt, test_data.class_names,criterion,test_logger)
    print("done")

test.py looks like:
 for i, (inputs, targets) in enumerate(data_loader):

    with torch.no_grad():
        inputs = Variable(inputs)
        targets = Variable(targets)
        print("targets.data", targets)
        outputs = model(inputs)