daa233 / generative-inpainting-pytorch

A PyTorch reimplementation for paper Generative Image Inpainting with Contextual Attention (https://arxiv.org/abs/1801.07892)
MIT License
471 stars 96 forks source link

Misalignment with TensorFlow weights #58

Open ncherel opened 3 years ago

ncherel commented 3 years ago

Hello, First of all, thank you for your great work.

I have observed a strange problem when using the converted weights from TensorFlow (thanks again!). I do not get exactly the same results than the official implementation. They are very close but slightly misaligned: output

The coarse network seems to do its job correctly but something happens during the refinement step. Do you have an idea of where it could come from ?

Tested with PyTorch 1.7 and TensorFlow 1.15

daa233 commented 3 years ago

@ncherel Thansk for your attention!

I just confirmed that there is a mislalignment for the output. Thanks for pointing out it happens in the refined stage.

The resullt of examples/imagenet/imagenet_patches_ILSVRC2012_val_00025892_input.png by the converted TF model: image

Sorry, I am not sure about the reason for this problem and have little time to find it recently.

Here are some possible reasons:

By the way, the TF model is converted by @zphang semi-manually in this pr, you may try to convert it by yourself and check it again.

ncherel commented 3 years ago

Thanks for your input. I finally managed to reproduce the official results using your code. I had to change a few things :

daa233 commented 3 years ago

Awesome! Could you please share your code in a branch/pull request so that other people may learn from it? Thanks for your excellent work!