Skip to content

Commit

Permalink
fix noise bug in test image inference
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Jetchev committed Dec 14, 2018
1 parent 3179fd7 commit 223b243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mosaicGAN.py
Expand Up @@ -192,7 +192,7 @@ def ganGeneration(content, noise,templates=None, bVis = False):
print("test image size", im.shape)
fixnoise2 = torch.FloatTensor(1, nz, im.shape[2] // 2 ** nDep, im.shape[3] // 2 ** nDep)
fixnoise2 = fixnoise2.to(device)
noise=setNoise(fixnoise2)
fixnoise2=setNoise(fixnoise2)
fakebig,_,_,_= splitW(im, fixnoise2, None, ganGeneration)
vutils.save_image(fakebig, '%s/mosaicTransfer_epoch_%03d_%s.jpg' % (opt.outputFolder, epoch, desc), normalize=True)
except Exception as e:
Expand All @@ -203,4 +203,4 @@ def ganGeneration(content, noise,templates=None, bVis = False):
##save/load model for later use if desired
#outModelName = '%s/netG_epoch_%d_%s.pth' % (opt.outputFolder, epoch*0,desc)
#torch.save(netU.state_dict(),outModelName )
#netU.load_state_dict(torch.load(outModelName))
#netU.load_state_dict(torch.load(outModelName))

0 comments on commit 223b243

Please sign in to comment.