[go: nahoru, domu]

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

Process is aborted (core dumped) when axis is a large negative integer when calling tf.gather #62603

Open
drewshark opened this issue Dec 9, 2023 · 2 comments
Assignees
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.15 For issues related to 2.15.x type:bug Bug

Comments

@drewshark
Copy link

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

2.16.0

Custom code

Yes

OS platform and distribution

No response

Mobile device

No response

Python version

No response

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I am actually using 2.10.0 but I find this issue insists in 2.16.0-dev20231209 (tf-nightly). Here is the code to reproduce:

import tensorflow as tf
params = tf.constant([[0.69]])
indices = tf.constant([16])
axis = tf.constant(-9223372036854775808, dtype='int64')
tf.gather(params,indices,axis=axis)

The process will directly be killed by the system when running above code.

Here is the related output:

2023-12-09 22:48:16.035701: F ./tensorflow/core/framework/tensor.h:832] Check failed: new_num_elements == NumElements() (0 vs. 1)
Aborted (core dumped)

Standalone code to reproduce the issue

import tensorflow as tf
params = tf.constant([[0.69]])
indices = tf.constant([16])
axis = tf.constant(-9223372036854775808, dtype='int64')
tf.gather(params,indices,axis=axis)

Relevant log output

No response

@google-ml-butler google-ml-butler bot added the type:bug Bug label Dec 9, 2023
@Venkat6871 Venkat6871 added comp:tf.function tf.function related issues TF 2.15 For issues related to 2.15.x labels Dec 12, 2023
@Venkat6871
Copy link

Hi @drewshark,
Sorry for the delay, Here you have set the axis parameter to a constant value with a very large negative number (-9223372036854775808). The axis parameter should be a valid integer corresponding to the axis along which you want to perform the gather operation. If you want to gather elements along a specific axis, you should provide the correct axis number. I provided a gist for reference.

Thank you!

@Venkat6871 Venkat6871 added the stat:awaiting response Status - Awaiting response from author label Dec 12, 2023
@drewshark
Copy link
Author

Hi @Venkat6871

If tf.gather is not expected to accept axis to be a large negative number. It would be much helpful if it can throw a proper error message indicating the incorrect usage of this function. However, currently, this function call will directly lead to a program abort, which will directly kill my process. The current behavior seems dangerous.

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Dec 12, 2023
@Venkat6871 Venkat6871 added comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower and removed comp:tf.function tf.function related issues labels May 22, 2024
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.15 For issues related to 2.15.x type:bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants