Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent size between output and target #17

Closed
yftzz opened this issue Jun 12, 2019 · 6 comments
Closed

Inconsistent size between output and target #17

yftzz opened this issue Jun 12, 2019 · 6 comments

Comments

@yftzz
Copy link

yftzz commented Jun 12, 2019

Hi, congrats on your great work.

I was trying to experimenting with your proposed code on a dataset other than cityscape, where I set the input image shape to be 512x512. But I see that with your default settings for the network, the output has a shape of 128x128, so do I have to add the code for upsampling manually based on your implementation?
I might me dumb somehow, but I don't see where to adjust the output shape.

Regards.

@Fly2flies
Copy link

I have the same confusion !
Before the Bottleneck, 2 convolution layers with stride 2 make the input down sample 4x. Should I up sample 4x after the final layer to recover the input size or change the stride of the first two convolution layer into 1 ?

@yftzz
Copy link
Author

yftzz commented Jun 13, 2019

I guess you might wanna check out other issues, the similar questions have been asked for a few times. But, my question is, put the bilinear upsampling layer before the final layer or after? cuz I believe if the final output comes from a bilinear upsampling layer, the output has to be a bit coarse.

@DragoniteDD
Copy link

Based on the author's reply here, it seems to be bilinear interpolation upsampling after the output
#15 (comment)

@Fly2flies
Copy link

Thanks for your reply. I've seen the issue. But it seems to be a little coarse to bilinear 4x to predict directly. I want to know whether you have some solutions to address it?

@sidml
Copy link

sidml commented Oct 31, 2019

If anyone else is wondering, how to train the model if the model output size is not equal to label size, check out this

@NickLucche
Copy link

Hey, another place where you might want to take a look at is the initial strided convolution "block"

x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
x = self.conv2(x)
x = self.bn2(x)
x = self.relu(x)
which effectively downscales the original input resolution; although editing it should be considered an architectural change, you can get your input resolution to stay constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants