Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

[Q] Why is there "resize_bilinear" for "image_level_features"? (I think it does nothing..) #229

Closed
ywpkwon opened this issue Jan 15, 2020 · 1 comment

Comments

@ywpkwon
Copy link

ywpkwon commented Jan 15, 2020

In the function "AtrousSpatialPyramidPoolingModule", (line 30, models/DeepLabV3.py)

There is "image_features" (line 41)

    feature_map_size = tf.shape(inputs)

    # Global average pooling
    image_features = tf.reduce_mean(inputs, [1, 2], keep_dims=True)
    image_features = slim.conv2d(image_features, depth, [1, 1], activation_fn=None)
    image_features = tf.image.resize_bilinear(image_features, (feature_map_size[1], feature_map_size[2]))

It looks to me that image_feature is reduce_mean(keep_dims=True) of inputs so has same size with the inputs.
feature_map_size is also the shape of inputs.

Then why is the resize_bilinear needed if image_features has already feature map_size?

@ywpkwon
Copy link
Author

ywpkwon commented Jan 24, 2020

Oh, I was confused. If you have a similar question, you may want to see rishizek/tensorflow-deeplab-v3#37.

@ywpkwon ywpkwon closed this as completed Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant