ResNet-decoder icon indicating copy to clipboard operation
ResNet-decoder copied to clipboard

reconstruction from resnet50 decoder not exactly the right dimensions

Open juliawilkins opened this issue 10 months ago • 0 comments

Thank you for the great work. I am trying to test the encoding and decoding via ResNet50 using the following code:

enc_net = enc.ResNetEncoder(enc.Bottleneck, [3, 4, 6, 3], return_indices=True).to(
    "cuda"
)

summary(enc_net, [2, 3, 224, 224])
test_input = torch.rand(2, 3, 224, 224).to("cuda")

print("in shape: ", test_input.shape)

out, indices = enc_net(test_input)

print("out encoder: ", out.shape)
print("out encoder indicies: ", indices.shape)

netD = ResNet50_Decoder(Bottleneck, [3, 4, 6, 3])

netD.to("cuda")
rec = netD(out, indices)

print("recon shape: ", rec.shape)

but I am seeing a small discrepency in reconstruction shape:

in shape:  torch.Size([2, 3, 224, 224])
out encoder:  torch.Size([2, 2048, 1, 1])
out encoder indicies:  torch.Size([2, 64, 56, 56])
recon shape:  torch.Size([2, 3, 223, 223])

223 vs. 224 in the pixel dimension. any tips - did you get this too? thanks!

juliawilkins avatar Apr 10 '24 22:04 juliawilkins