DMFN icon indicating copy to clipboard operation
DMFN copied to clipboard

512x512 image sizes

Open muxgt opened this issue 4 years ago • 2 comments

Hi! Thanks for your code before the official release! I wonder if it can work with 512x512 image sizes. I'm receiving this error: RuntimeError: The size of tensor a (16) must match the size of tensor b (32) at non-singleton dimension 3 in this line: c_u_k = sum_u_v(self.coord_x * tar) / sum_tar line 84, in calc_align_loss Can I tweak something to make it work?

muxgt avatar Apr 04 '20 20:04 muxgt

change 1/8 to 1/16 in this line, you will get the correct grid number https://github.com/HannH/DMFN/blob/c12a42b2e0023bb52838afa4a14c48e4bfbe52f0/model/loss.py#L49

HannH avatar May 28 '20 01:05 HannH

Now it gives different error.

Traceback (most recent call last): File "/content/DMFN/train.py", line 45, in ourModel.optimize_parameters() File "/content/DMFN/model/net.py", line 294, in optimize_parameters self.forward_G() File "/content/DMFN/model/net.py", line 258, in forward_G xf = self.netD('adv', self.completed, self.completed_local) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/content/DMFN/model/net.py", line 143, in forward return self.forward_adv(*input) File "/content/DMFN/model/net.py", line 148, in forward_adv x_global = self.global_discriminator(x_g) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/content/DMFN/model/net.py", line 120, in forward self.logit = self.layers-1 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/modules/linear.py", line 87, in forward return F.linear(input, self.weight, self.bias) File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 1610, in linear ret = torch.addmm(bias, input, weight.t()) RuntimeError: size mismatch, m1: [4 x 32768], m2: [8192 x 512] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:283

muxgt avatar Jun 01 '20 19:06 muxgt