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

Switch over to max_pool_v2 in Python #14983

Merged

Conversation

yongtang
Copy link
Member

This fix is a follow up to #11875 so that MaxPool in Python use v2 version. As 11875 has been merged several months ago, this fix conforms to the deprecation policy.

This fix is realted to #11875 and #4746.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

@yongtang yongtang force-pushed the 11875-ksize-max-pool-v2-follow-up branch 2 times, most recently from 25ed43b to 65f377f Compare December 1, 2017 00:33
@yongtang yongtang changed the title [Working in Progress] Switch over to max_pool_v2 in Python Switch over to max_pool_v2 in Python Dec 1, 2017
@drpngx drpngx requested a review from rmlarsen December 4, 2017 02:52
@drpngx drpngx added the awaiting review Pull request awaiting review label Dec 4, 2017
stride_x = strides_attr.list.i[2]
if node.op == "MaxPoolV2":
strides_input_name = node.input[2]
if not strides_input_name.endswith("/strides"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe? Could there possible be multiple strides tensors in the innermost scope, e.g. strides_1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmlarsen I think it is fine. The name is node.input[2] and the op is checked with node.op == "MaxPoolV2".

if not strides_input_name.endswith("/strides"):
raise ValueError("Strides name does not end with '/strides'")
strides_node = name_to_order_node[strides_input_name].node
if strides_node.op != "Const":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to be Const? Isn't the point of the new version that it can take a computed tensor value as argument?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmlarsen Removed. Thanks.

if node.op == "MaxPoolV2":
ksize_input_name = node.input[1]
if not ksize_input_name.endswith("/ksize"):
raise ValueError("Kernel size name does not end with '/ksize'")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same concern about uniqueness here?

raise ValueError("Kernel size name does not end with '/ksize'")
ksize_node = name_to_order_node[ksize_input_name].node
if ksize_node.op != "Const":
raise ValueError("Kernel size op is not Const")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a Const node?

@rmlarsen rmlarsen added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review labels Dec 14, 2017
@yongtang yongtang force-pushed the 11875-ksize-max-pool-v2-follow-up branch from 6115296 to 23fb065 Compare December 19, 2017 01:54
@yongtang
Copy link
Member Author

Thanks @rmlarsen for the review. The PR has been updated.

@drpngx
Copy link
Contributor

drpngx commented Dec 26, 2017

@rmlarsen WDYT?

@tensorflowbutler
Copy link
Member

Nagging Awaiting Response: It has been 14 days with no activityand the awaiting response label was assigned. Is this still an issue?

@rmlarsen
Copy link
Member

@yongtang sorry about dropping this. Please resolve the conflicts.

@rmlarsen rmlarsen self-assigned this Jan 24, 2018
This fix is a follow up to 11875 so that MaxPool in Python
use v2 version. As 11875 has been merged some time ago,
this fix conforms to the deprecation policy.

This fix is realted to 11875 and 4746.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
…> MaxPoolV2

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Update tensorflow/contrib/receptive_field
due to max_pool's strides and ksize from  attr -> input

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang yongtang force-pushed the 11875-ksize-max-pool-v2-follow-up branch from 23fb065 to 5af65cb Compare January 24, 2018 20:02
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang yongtang force-pushed the 11875-ksize-max-pool-v2-follow-up branch from 5af65cb to 3208084 Compare January 24, 2018 21:06
@yongtang
Copy link
Member Author

@rmlarsen The PR has been rebased with conflict resolved. Please take a look.

@rmlarsen rmlarsen added awaiting testing (then merge) kokoro:force-run Tests on submitted change and removed stat:awaiting response Status - Awaiting response from author labels Jan 24, 2018
@kokoro-team kokoro-team removed kokoro:run kokoro:force-run Tests on submitted change labels Jan 26, 2018
@rmlarsen rmlarsen added kokoro:run kokoro:force-run Tests on submitted change and removed kokoro:run labels Jan 26, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jan 26, 2018
@rmlarsen
Copy link
Member

@yongtang this appears to break some tests in tensorflow/compiler:

https://source.cloud.google.com/results/invocations/cc0169ef-2973-4bee-839e-94ba7b4e043b/targets

please take a look.

@rmlarsen rmlarsen added the stat:awaiting response Status - Awaiting response from author label Jan 26, 2018
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@rmlarsen rmlarsen removed the stat:awaiting response Status - Awaiting response from author label Jan 26, 2018
@rmlarsen rmlarsen merged commit 995378c into tensorflow:master Jan 26, 2018
@yongtang yongtang deleted the 11875-ksize-max-pool-v2-follow-up branch January 26, 2018 20:14
@rmlarsen
Copy link
Member

@yongtang we are going to temporarily revert this change for the upcoming release to make sure this is also supported by the MKL accelerated code when enabled.

@yongtang
Copy link
Member Author

Thanks @rmlarsen. I didn't know it caused the issue in MKL. Let me know if I can be of any help with migrating MKL's max_pool to v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants