Skip to content

tf.math.tanh makes silently crash Python #46408

@jplu

Description

@jplu

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): Windows 10 64 Bits build 21286
  • TensorFlow installed from (source or binary): binary from pip
  • TensorFlow version (use command below): 2.5.0-dev20210113
  • Python version: Python 3.8.5 with Miniconda 4.9.2
  • CUDA/cuDNN version: CUDA 11.0 / CuDNN 8.0.6
  • GPU model and memory: GeForce RTX 2080 Super with Max-Q Design with 8Go

Describe the current behavior
The Python interpreter crashes silently without any error when using the tf.math.tanh() function.

Describe the expected behavior
Works without crashing

Standalone code to reproduce the issue

import tensorflow as tf
x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
tf.math.tanh(x)

Other info / logs
When running python -u -m trace -t crash.py the last lines are:

 --- modulename: gen_math_ops, funcname: tanh
gen_math_ops.py(10769):   _ctx = _context._context or _context.context()
gen_math_ops.py(10770):   tld = _ctx._thread_local_data
gen_math_ops.py(10771):   if tld.is_eager:
gen_math_ops.py(10772):     try:
gen_math_ops.py(10773):       _result = pywrap_tfe.TFE_Py_FastPathExecute(
gen_math_ops.py(10774):         _ctx, "Tanh", name, x)
gen_math_ops.py(10773):       _result = pywrap_tfe.TFE_Py_FastPathExecute(

You can also find in attachment a screenshot of the crash.
crash

Metadata

Metadata

Assignees

Labels

TF 2.5Issues related to TF 2.5comp:opsOPs related issuesregression issueTo spot regression issues in latest versionstat:awaiting tensorflowerStatus - Awaiting response from tensorflowertype:bugBug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions