-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
MaxPooling2d() turns odd input into even numbers, is there anyway to go around this? #4818
Comments
You can use |
@thefiddler great Thanks, now that solved my first Issue, I realized I have a problem in the UpSampling2D() only doing I might add a ZeroPadding()? |
Indeed, For example, if your network has 7x input = Input(shape)
x = ZeroPadding2D((12, 12, 16, 16))(input)
# rest of your network here
x = Cropping2D(((12, 12), (16, 16))(x)
model = Model(input, x) |
Thanks a lot for the detailed answer, I'm wondering how would the ZeroPadding effect the model over all. I'm essentially implementing the full version of Segnet and in the original paper they don't seem to do either cropping or ZeroPadding, but will definitely try this out. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, but feel free to re-open it if needed. |
During
MaxPooling2d()
the row with odd number[ 45 ]
becomes even[ 22 ]
, this becomes an issue during Deconv or let's sayUpSampling2D()
, it doesn't count up to the same sizes as it started.Here is a gist of the full model, but what I'm pointing to is the
maxpooling2d_59
The issue is here, at size
22
to44
, rather45
It causes this error otherwise continuing to a
Reshape()
.Relevant issues and each seem to solve it a different way:
The text was updated successfully, but these errors were encountered: