Open youyangzhe opened 6 years ago
python3 train.py Namespace(annealEvery=400, annealStart=0, batchSize=1, beta1=0.5, dataroot='/home/ol/DCPDN-master/facades/train512 ', dataset='pix2pix', display=5, evalIter=50, exp='/home/ol/DCPDN-master/checkpoints_new ', imageSize=256, inputChannelSize=3, lambdaGAN=0.35, lambdaIMG=1, lrD=0.0002, lrG=0.0002, mode='B2A', ndf=64, netD='', netG='/home/ol/DCPDN-master/demo_model/netG_epoch_8.pth', ngf=64, niter=400, originalSize=286, outputChannelSize=3, poolSize=50, valBatchSize=150, valDataroot='/home/ol/DCPDN-master/facades/test512 ', wd=0.0, workers=1) Random Seed: 8382 /usr/local/lib/python3.5/dist-packages/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. "please use transforms.Resize instead.") Traceback (most recent call last): File "train.py", line 123, in netG.load_state_dict(torch.load(opt.netG)) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 490, in load_state_dict .format(name)) KeyError: 'unexpected key "tran_dense.dense_block1.denselayer1.norm.1.weight" in state_dict'
I also have the same problem.I use the python2,torch0.31. Have you resolved the issue?
I encounter this too.And I use python2.7 torch0.3.1.
pytorch0.4改成 netG.load_state_dict(torch.load(opt.netG),strict=False)
python3 train.py Namespace(annealEvery=400, annealStart=0, batchSize=1, beta1=0.5, dataroot='/home/ol/DCPDN-master/facades/train512 ', dataset='pix2pix', display=5, evalIter=50, exp='/home/ol/DCPDN-master/checkpoints_new ', imageSize=256, inputChannelSize=3, lambdaGAN=0.35, lambdaIMG=1, lrD=0.0002, lrG=0.0002, mode='B2A', ndf=64, netD='', netG='/home/ol/DCPDN-master/demo_model/netG_epoch_8.pth', ngf=64, niter=400, originalSize=286, outputChannelSize=3, poolSize=50, valBatchSize=150, valDataroot='/home/ol/DCPDN-master/facades/test512 ', wd=0.0, workers=1) Random Seed: 8382 /usr/local/lib/python3.5/dist-packages/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. "please use transforms.Resize instead.") Traceback (most recent call last): File "train.py", line 123, in
netG.load_state_dict(torch.load(opt.netG))
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 490, in load_state_dict
.format(name))
KeyError: 'unexpected key "tran_dense.dense_block1.denselayer1.norm.1.weight" in state_dict'