Pytorch-cyclegan-and-pix2pix: test resnet_9blocks or resnet_6blocks then such error appears:KeyError: 'unexpected key "model.10.conv_block.6.weight" in state_dict'

Created on 12 Oct 2017  ·  3Comments  ·  Source: junyanz/pytorch-CycleGAN-and-pix2pix

When testing resnet_9blocks model, this error appeared: KeyError: 'unexpected key "model.10.conv_block.6.weight" in state_dict'
and so did the model of resnet_6blocks.
why i trained resnet model,there was no bug ,but tested it unsuccessfully?
Hoping your help.

Most helpful comment

In my opinion, you may forget to add "--no_dropout".

All 3 comments

This might be caused by different flags used in training and test scripts. For example, if one might use batchnorm for training, but have instancenorm for test.

Thanks a lot : )

In my opinion, you may forget to add "--no_dropout".

Was this page helpful?
0 / 5 - 0 ratings