Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleDataset init and pytorch 1.0.1 compatible #138

Merged
merged 1 commit into from
Dec 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_transform(opt):
transform_list = []
if opt.resize_or_crop == 'resize_and_crop':
osize = [opt.loadSizeX, opt.loadSizeY]
transform_list.append(transforms.Scale(osize, Image.BICUBIC))
transform_list.append(transforms.Resize(osize, Image.BICUBIC))
transform_list.append(transforms.RandomCrop(opt.fineSize))
elif opt.resize_or_crop == 'crop':
transform_list.append(transforms.RandomCrop(opt.fineSize))
Expand Down
1 change: 1 addition & 0 deletions data/custom_dataset_data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def CreateDataset(opt):
elif opt.dataset_mode == 'single':
from data.single_dataset import SingleDataset
dataset = SingleDataset()
dataset.initialize(opt)
else:
raise ValueError("Dataset [%s] not recognized." % opt.dataset_mode)

Expand Down
6 changes: 4 additions & 2 deletions models/test_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import torch
from torch.autograd import Variable
from collections import OrderedDict
import util.util as util
Expand Down Expand Up @@ -33,8 +34,9 @@ def set_input(self, input):
self.image_paths = input['A_paths']

def test(self):
self.real_A = Variable(self.input_A, volatile=True)
self.fake_B = self.netG.forward(self.real_A)
with torch.no_grad():
self.real_A = Variable(self.input_A)
self.fake_B = self.netG.forward(self.real_A)

# get image paths
def get_image_paths(self):
Expand Down