Hugues1965
(Hugues)
September 26, 2018, 3:00pm
238
Hello all and @jeremy
I’m kind of stuck on my project, I’m reaching 80% accuracy but I think I can do better, my data is unbalanced, I would really like to try a GAN to augment my data, I’m almost there. I have followed Lesson 12 but I have 3 blocking points in each of these posts of mine:
Hi all,
My output images are not quite right when I run wgan.ipynb from Lesson 12.
I have download the 20% sample and unzipped it under fastai/courses/dl2/ so that i have data/lsun/bedroom below dl2.
I run all the code, no error messages. The output of the first train(1, False) line is:
Loss_D [-1.53975]; Loss_G [0.77398]; D_real [-0.76954]; Loss_D_fake [0.77021]
and the second train(1, False) is:
Loss_D [-1.53432]; Loss_G [0.76891]; D_real [-0.77165]; Loss_D_fake [0.76267]
Both run in ab…
Hi all,
in dl2/wgan.ipynb, the last cell saves the model I believe:
torch.save(netG.state_dict(), TMP_PATH/‘netG_2.h5’)
torch.save(netD.state_dict(), TMP_PATH/‘netD_2.h5’)
But then how can i reload this model later on to continue training it ?
I’ve tried this code but I’m not sure how to call my model:
torch.load(TMP_PATH/‘netG_2.h5’)
torch.load(TMP_PATH/‘netD_2.h5’)
model.load_state_dict(netG.state_dict())
model.load_state_dict(netD.state_dict())
Hello,
In dl2/wgan.ipynb, the following code produces an 8x8 matrix > with the fake images:
netD.eval(); netG.eval();
fake = netG(fixed_noise).data.cpu()
faked = np.clip(md.trn_ds.denorm(fake),0,1)
plt.figure(figsize=(9,9))
plt.imshow(gallery(faked, 8));
How can we modify this code to get only one fake image with normal resolution ? I’m using a GAN for data augmentation so I cannot use the matrix.
thanks
If someone could guide me by replying into the specific thread, thanks a lot for your help.