def init_models(opt): #generator initialization: netG = models.Generator_no_res(opt).to(opt.device) netG.apply(models.weights_init) #discriminator initialization: netD = models.WDiscriminator(opt).to(opt.device) netD.apply(models.weights_init) return netD, netG
def init_models(opt): #generator initialization: netG = models.Generator_no_res(opt).to(opt.device) netG.apply(models.weights_init) if opt.netG != '': netG.load_state_dict(torch.load(opt.netG)) #discriminator initialization: netD = models.WDiscriminator(opt).to(opt.device) netD.apply(models.weights_init) if opt.netD != '': netD.load_state_dict(torch.load(opt.netD)) return netD, netG