diff options
| author | Jun-Yan Zhu <junyanz@users.noreply.github.com> | 2018-01-14 20:51:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-14 20:51:15 -0500 |
| commit | 7ed6fac6cee515ca8868becb6bda37786563ea96 (patch) | |
| tree | 84b8dec95920763a8afaff11ae04255066f29fa7 /models/test_model.py | |
| parent | beed9ba76a88da7bb4fe09094fe6e175f6b2d0de (diff) | |
| parent | 1c5c2f50da5ae101077c27fdac2a12fb1619ec86 (diff) | |
Merge pull request #187 from SsnL/resize_
Fix resize_ issue #170
Diffstat (limited to 'models/test_model.py')
| -rw-r--r-- | models/test_model.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/test_model.py b/models/test_model.py index 2ae2812..f593c46 100644 --- a/models/test_model.py +++ b/models/test_model.py @@ -12,8 +12,6 @@ class TestModel(BaseModel): def initialize(self, opt): assert(not opt.isTrain) BaseModel.initialize(self, opt) - self.input_A = self.Tensor(opt.batchSize, opt.input_nc, opt.fineSize, opt.fineSize) - self.netG = networks.define_G(opt.input_nc, opt.output_nc, opt.ngf, opt.which_model_netG, opt.norm, not opt.no_dropout, @@ -29,7 +27,9 @@ class TestModel(BaseModel): def set_input(self, input): # we need to use single_dataset mode input_A = input['A'] - self.input_A.resize_(input_A.size()).copy_(input_A) + if len(self.gpu_ids) > 0: + input_A = input_A.cuda(self.gpu_ids[0], async=True) + self.input_A = input_A self.image_paths = input['A_paths'] def test(self): |
