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

tf.math.segment_max/min/mean/sun/prod crashes(aborts) when segment_ids is large #46888

Closed
DNXie opened this issue Feb 3, 2021 · 4 comments · Fixed by #51733
Closed

tf.math.segment_max/min/mean/sun/prod crashes(aborts) when segment_ids is large #46888

DNXie opened this issue Feb 3, 2021 · 4 comments · Fixed by #51733
Assignees
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:bug Bug

Comments

@DNXie
Copy link

DNXie commented Feb 3, 2021

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below):2.1.0
  • Python version:3.7.6
  • Bazel version (if compiling from source):N/A
  • GCC/Compiler version (if compiling from source):N/A
  • CUDA/cuDNN version:N/A
  • GPU model and memory:N/A

Describe the current behavior
tf.math.segment_max/min/mean/sun/prod crashes(aborts) when segment_ids is large

Describe the expected behavior
expect an exception message if the input is unexpected instead of crash

Standalone code to reproduce the issue

tf.math.segment_max(data=np.ones((1,10,1)), segment_ids=[1676240524292489355])
tf.math.segment_min(data=np.ones((1,10,1)), segment_ids=[1676240524292489355])
tf.math.segment_mean(data=np.ones((1,10,1)), segment_ids=[1676240524292489355])
tf.math.segment_sum(data=np.ones((1,10,1)), segment_ids=[1676240524292489355])
tf.math.segment_prod(data=np.ones((1,10,1)), segment_ids=[1676240524292489355])

Output:

2021-02-03 16:44:25.849065: F tensorflow/core/framework/tensor_shape.cc:405] Check failed: 0 <= new_num_elements (0 vs. -1684338830784658056)
Aborted (core dumped)

Related issue: #46696

@amahendrakar
Copy link
Contributor

Was able to reproduce the issue with TF v2.3, TF v2.4 and TF-nightly. Please find the gist of it here. Thanks!

@amahendrakar amahendrakar added comp:ops OPs related issues TF 2.4 for issues related to TF 2.4 labels Feb 4, 2021
@rmothukuru rmothukuru added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 5, 2021
@sushreebarsa
Copy link
Contributor

Was able to reproduce this issue in TF 2.6.0-dev20210528,please find the gist here ..Thanks !

@yongtang
Copy link
Member

Added a PR #51733 for the fix.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:bug Bug
Projects
None yet
5 participants