Zhaoyi-Yan / Shift-Net_pytorch

Pytorch implementation of Shift-Net: Image Inpainting via Deep Feature Rearrangement (ECCV, 2018)
http://openaccess.thecvf.com/content_ECCV_2018/papers/Zhaoyi_Yan_Shift-Net_Image_Inpainting_ECCV_2018_paper.pdf
MIT License
363 stars 83 forks source link

On what image sizes can Face Shift-net work? #117

Closed muxgt closed 4 years ago

muxgt commented 4 years ago

From non-square sizes it worked for me only on 512x768. On other sizes it gives this:

Traceback (most recent call last): File "/content/Shift-Net_pytorch/train.py", line 65, in model.optimize_parameters() File "/content/Shift-Net_pytorch/models/face_shift_net/face_shiftnet_model.py", line 408, in optimize_parameters self.forward() File "/content/Shift-Net_pytorch/models/face_shift_net/face_shiftnetmodel.py", line 226, in forward , flip_feat = self.netG(self.real_A_flip) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, kwargs) File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 153, in forward return self.module(*inputs[0], *kwargs[0]) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, kwargs) File "/content/Shift-Net_pytorch/models/modules/shift_unet.py", line 224, in forward d3 = self.d3_norm(self.d3dc(F.relu(torch.cat([d2, e6], dim=1)))) RuntimeError: Sizes of tensors must match except in dimension 2. Got 13 and 12

Is it the intended behavior? Becauase regular Shift-net works on all image sizes.

Zhaoyi-Yan commented 4 years ago

No, I will fix it in one hour.

muxgt commented 4 years ago

Thank you! It's working.