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

Make PSPNet Fully-convolutional #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrlzla
Copy link
Contributor

@mrlzla mrlzla commented Mar 12, 2018

There was no way to use PSPNet as fully convolutional network because we had hardcoded AveragePooling builded in interp_block:

if input_shape == (473, 473):
        kernel_strides_map = {1: 60,
                              2: 30,
                              3: 20,
                              6: 10}
    elif input_shape == (713, 713):
        kernel_strides_map = {1: 90,
                              2: 45,
                              3: 30,
                              6: 15}
    else:
        print("Pooling parameters for input shape ",
              input_shape, " are not defined.")
        exit(1)
kernel = (kernel_strides_map[level], kernel_strides_map[level])
strides = (kernel_strides_map[level], kernel_strides_map[level])
prev_layer = AveragePooling2D(kernel, strides=strides)(prev_layer)

So we were able to use the network only with static shape. That is not flexible because:

  1. We could only train the models that have input_shape either (473, 473) or (713, 713)
  2. We could only train the models with one shape ( f.e. we couldn't feed two images with shape (473, 473) and (713, 713) during one train process).
    This two restrictions were fixed with this pull_request.

@Vladkryvoruchko Vladkryvoruchko mentioned this pull request Sep 25, 2019
11 tasks
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

Successfully merging this pull request may close these issues.

1 participant