ypxie / HDGan

Pytorch implementation of HDGan
150 stars 36 forks source link

Unable to load pre-trained model for COCO #6

Closed metro-smiles closed 6 years ago

metro-smiles commented 6 years ago

Hi,

So I am having trouble loading the pre-trained model for COCO. It says that a key is missing in the saved model: missing keys in state_dict: "{\'module.tensor_to_img_128.1.weight\'}". Any help would be much appreciated.

coco_issues

By the way, the pre-trained models for birds, and flowers have worked fine.

zizhaozhang commented 6 years ago

In my original code (https://github.com/ypxie/HDGan/blob/42818cefb13ee35f7daaed2fa1e4df7ea6f4771d/HDGan/HDGan_test.py#L46). I set strict to False. Did you changed the code? If not, it should work as I just tried. I assume the coco model I uploaded is the one without 128 output.. I will upload the model with all side output later on. If it works, try to see if the generated 256 images look fine. If not, pls let me know.

metro-smiles commented 6 years ago

Hi, Appreciate your prompt reply. Indeed I had to fix this manually....turns out I was using an older version of PyTorch, which does not have 'strict' as a parameter for the load_state_dict function. So I manually edited modules.py to fix this. Now it works.

But the synthesized images at 256 res. aren't nearly as good as those for birds, and flowers.

zizhaozhang commented 6 years ago

Hi Yes It is better to use a version at least equal to what we specified. COCO is way harder dataset. It is known challenge.