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.

Feature Extraction from Last Global Average Pooling Layer

See original GitHub issue

I am trying to extract features from the last global average pooling layer. but the final tensor after

net = tf.nn.avg_pool3d(net, ksize=[1, 2, 7, 7, 1],
                             strides=[1, 1, 1, 1, 1], padding=snt.VALID)

is of size (1, 6, 1, 1, 1024) Is there a meaning in that ? am I doing something wrong ? I was hoping for only 1 feature vector of size 1x1024 not 6 of them

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mourad1081commented, Aug 3, 2019

@Anirudh58 and @rishabh2301, I added the max_pool3d(...) line that estathop mentionned here to get the (1, 1, 1, 1, 1024) vector: (in i3d.py)

...
end_point = 'Logits'
with tf.variable_scope(end_point):
    net = tf.nn.avg_pool3d(net, ksize=[1, 2, 7, 7, 1], strides=[1, 1, 1, 1, 1], padding=snt.VALID)
    # To get the features, I add this line because I have a vector (1, x, 1, 1, 1024) otherwise..
    # cf. https://github.com/deepmind/kinetics-i3d/issues/40
    net = tf.nn.max_pool3d(net, ksize=[1, net.get_shape()[1], 1, 1, 1], strides=[1, 1, 1, 1, 1], padding=snt.VALID)
    ...
0reactions
Anirudh58commented, Jun 26, 2019

hello @rishabh2301 I am working on a similar problem statement. Did you figure out how to use this code to extract features?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Global Average Pooling Explained | Papers With Code
Global Average Pooling is a pooling operation designed to replace fully connected layers in classical CNNs. The idea is to generate one feature...
Read more >
Global Average Pooling Layers for Object Localization
The first paper to propose GAP layers designed an architecture where the final max pooling layer contained one activation map for each image ......
Read more >
261 - What is global average pooling in deep learning?
What is the Global Average Pooling (GAP layer ) and how it can be used to summrize features in an image?Code generated in...
Read more >
Global Pooling in Convolutional Neural Networks
In this article, we explore what global average and max pooling entail. We discuss why they have come to be used and how...
Read more >
A Gentle Introduction to Pooling Layers for Convolutional ...
Pooling is required to down sample the detection of features in feature maps. How to calculate and implement average and maximum pooling in ......
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