Skip to content

reconstruction from resnet50 decoder not exactly the right dimensions #3

@juliawilkins

Description

@juliawilkins

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions