-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Switch over to max_pool_v2 in Python #14983
Conversation
25ed43b
to
65f377f
Compare
stride_x = strides_attr.list.i[2] | ||
if node.op == "MaxPoolV2": | ||
strides_input_name = node.input[2] | ||
if not strides_input_name.endswith("/strides"): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'") |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a Const node?
6115296
to
23fb065
Compare
Thanks @rmlarsen for the review. The PR has been updated. |
@rmlarsen WDYT? |
Nagging Awaiting Response: It has been 14 days with no activityand the |
@yongtang sorry about dropping this. Please resolve the conflicts. |
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>
23fb065
to
5af65cb
Compare
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
5af65cb
to
3208084
Compare
@rmlarsen The PR has been rebased with conflict resolved. Please take a look. |
@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. |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@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. |
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. |
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