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

Convert Lambda layer to Reshape layer in global avg pooling #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doronHarnoy
Copy link

The purpose of this PR is to convert Keras Lambda layers in Keras specific layers when converting global avg pooling operation

We are converting here Lambda layer that expanded dimensions twice (convert shape from [x1,x2,..xn] to [x1,x2,..xn,1,1])
to Keras reshape layer that will keep the same result

@bourcierj
Copy link

bourcierj commented Jul 3, 2022

Hi,
I noted that in with a TensorFlow version > 2.6 we can use keepdims=True in tf.keras.layers.GlobalAveragePooling2D to avoid the need for an extra Reshape layer. FWIW, here is a link to a fix in my fork.

@doronHarnoy
Copy link
Author

Hi, I noted that in with a TensorFlow version > 2.6 we can use keepdims=True in tf.keras.layers.GlobalAveragePooling2D to avoid the need for an extra Reshape layer. FWIW, here is a link to a fix in my fork.

Great man! thanks

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.

2 participants