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

Aborted (core dumped) in tf.raw_ops.NearestNeighbors #66765

Open
LongZE666 opened this issue May 1, 2024 · 1 comment
Open

Aborted (core dumped) in tf.raw_ops.NearestNeighbors #66765

LongZE666 opened this issue May 1, 2024 · 1 comment
Assignees

Comments

@LongZE666
Copy link

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

tf 2.16.1

Custom code

Yes

OS platform and distribution

Ubuntu 20.04

Mobile device

No response

Python version

3.11

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

Parameter k being set to a negative number will cause a crash.

Standalone code to reproduce the issue

import tensorflow as tf

points = tf.constant(0.554979503, shape=[1000,100], dtype=tf.float32)
centers = tf.constant(0.554979503, shape=[1000,100], dtype=tf.float32)
k = tf.constant(-1250999896764, shape=[], dtype=tf.int64)
tf.raw_ops.NearestNeighbors(points=points, centers=centers, k=k)

Relevant log output

2024-05-01 03:49:00.796702: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -1250999896764
Aborted (core dumped)
@Venkat6871
Copy link

Hi @LongZE666 ,

  • I tried to run your code on colab using TF v2.16.1, nightly and faced the same issue. Please find the gist here for reference.

Thank you!

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

No branches or pull requests

2 participants