tensorflow / tensorflow

An Open Source Machine Learning Framework for Everyone

Home Page:https://tensorflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aborted (core dumped) with `tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient`

LongZE666 opened this issue · comments

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?

Check Failed in tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient when the input of inputs is scalar, which causes the program to crash.

Standalone code to reproduce the issue

# FakeQuantWithMinMaxVarsPerChannelGradientOp

import tensorflow as tf

num_bits = 8
narrow_range = False
gradients = tf.constant(0, shape=[], dtype=tf.float32)
inputs = tf.constant(0, shape=[], dtype=tf.float32)
min = tf.constant(124, shape=[3,1], dtype=tf.float32)
max = tf.constant(124, shape=[3,1], dtype=tf.float32)
tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient(gradients=gradients, inputs=inputs, min=min, max=max, num_bits=num_bits, narrow_range=narrow_range)

Relevant log output

2024-05-01 03:10:46.669162: F tensorflow/core/framework/tensor_shape.cc:356] Check failed: d >= 0 (0 vs. -1)
Aborted (core dumped)
commented

Hi @LongZE666 ,

Thanks for reporting. I have reproduced the reported behaviour and attached gist here.

The check fail observed when the inputs arg shape is empty.

Attaching also snapshot of same below.

Screenshot 2024-05-02 at 9 44 04 AM