New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo execution error #10
Comments
I have the same wrong,do you solve it ? |
netG.load_state_dict(torch.load(opt.netG),strict=False) |
Thank you ! |
I have solved the problem. To change the method of loading the model. If you need ,can leave a message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I stopped at the error message while executing demo.py
(M.S.Song-pytorch) ubuntu@ubuntu:~/Drive_B/A.H.Cha_B/DCPDN$ python demo.py --dataroot ./facades/nat_new4 --valDataroot ./facades/nat_new4 --netG ./demo_model/netG_epoch_8.pth Namespace(annealEvery=400, annealStart=0, batchSize=1, beta1=0.5, dataroot='./facades/nat_new4', dataset='pix2pix', display=5, evalIter=500, exp='sample', imageSize=1024, inputChannelSize=3, lambdaGAN=0.01, lambdaIMG=1, lrD=0.0002, lrG=0.0002, mode='B2A', ndf=64, netD='', netG='./demo_model/netG_epoch_8.pth', ngf=64, niter=400, originalSize=1024, outputChannelSize=3, poolSize=50, valBatchSize=1, valDataroot='./facades/nat_new4', wd=0.0, workers=1) Random Seed: 7412 /home/ubuntu/anaconda3/envs/M.S.Song-pytorch/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/transforms/transforms.py:191: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. Traceback (most recent call last): File "demo.py", line 134, in <module> netG.load_state_dict(torch.load(opt.netG)) File "/home/ubuntu/anaconda3/envs/M.S.Song-pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 522, in load_state_dict .format(name)) KeyError: 'unexpected key "tran_dense.dense_block1.denselayer1.norm.1.weight" in state_dict'
I put in 36 of h5 file in nat_new4 in facades, and put in 400 of h5 file in val512 in facades.
my system info:
Linux
python 3.6.6
pytorch 0.3.1 cuda80
conda 4.3.30
can i solve this problem?
KeyError: 'unexpected key "tran_dense.dense_block1.denselayer1.norm.1.weight" in state_dict'
thanks for reading
The text was updated successfully, but these errors were encountered: