question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unet error with (1,3,256,256) input

See original GitHub issue

I’m try to input a tensor with the size of (1, 3, 256, 256), after many conv2d and maxpool, the centre feature size is (1, 256, 8, 8), and the covn4 is (1, 128, 24, 24), after up_layer, the feature size is (1, 128, 12, 12), and after up is (1,64,24,24), but the conv3 is (1, 64, 57, 57), and if this size goes with cropping, it will be (1,64,23,23), which is different from (1,64,24,24), and makes an error.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
flyking1994commented, Oct 16, 2019
def forward(self, inputs1, inputs2):
    outputs2 = self.up(inputs2)
    offset1 = outputs2.size()[2] - inputs1.size()[2]
    offset2 = inputs1.size()[2] - outputs2.size()[2]
    padding = 2 * [offset1//2, -(offset2//2)]  
    outputs1 = F.pad(inputs1, padding)
    return self.conv(torch.cat([outputs1, outputs2], 1))

I changed the calculation method of padding. It seems that this problem has been solved.

0reactions
svanbodegravencommented, Oct 17, 2019

Thanks @flyking1994, +1 here for Cityscapes datasets gtFine_trainvaltest.zip and leftImg8bit_trainvaltest.zip, cropped and resized to (224, 224). Will try a run later with the original size of (2048, 1024)

Read more comments on GitHub >

github_iconTop Results From Across the Web

UNet Training Error: Size of Tensors Mismatched #678 - GitHub
I'm currently experiencing mismatch between my input tensors while trying to train UNet with BraTS2018 data. I'm working off of the spleen ...
Read more >
Error trying unet architecture for classification - Fast.ai forums
I am trying to create an image classifier based on the lessons of part 1. I was successful using a cnn but I...
Read more >
Error in Image Segmentation using Unet and Keras
I am using a Unet model for satellite image segmentation with inputs 512x512x3. But on executing the model i am getting the following...
Read more >
Tao unet input size error - NVIDIA Developer Forums
Please provide the following information when requesting support. • Hardware RTX3090 • Network Type unet / vgg16 • TLT Version dockers: ...
Read more >
Understanding Semantic Segmentation with UNET
Applications; Business Problem; Understanding the data ... i) A 3D volume (input image) of size (nin x nin x channels).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found