tensorflow: Python crashes when computing max/min of a complex tensor

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.1
  • Python version: 3.6.8

Describe the current behavior When taking (by mistake) the max value of a tensor with complex dtype, tf crashes python.

Describe the expected behavior Tf should fail gracefully, i.e. throwing an error.

Standalone code to reproduce the issue

import tensorflow as tf
tf.reduce_max(tf.ones((9,), dtype=tf.complex64))

Other info / logs

2020-03-09 15:40:04.604547: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2020-03-09 15:40:04.604625: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
2020-03-09 15:40:04.604723: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (zaccharie-Latitude-7490): /proc/driver/nvidia/version does not exist
2020-03-09 15:40:04.605857: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-03-09 15:40:04.645752: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2112000000 Hz
2020-03-09 15:40:04.647241: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4c32870 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-03-09 15:40:04.647293: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-03-09 15:40:04.671854: F tensorflow/compiler/xla/literal_util.cc:212] C64 element type has no minimum value
[1]    23558 abort (core dumped)  ipython

I tried on machine with and without GPU for the same result.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments