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

Segmentation Fault with tf.io.decode_csv , numpy record_defaults and tensor input #25426

Closed
annemariet opened this issue Feb 1, 2019 · 3 comments
Assignees
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug

Comments

@annemariet
Copy link

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):
    Ubuntu 16.04.4 LTS on Windows Linux SubSystem
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
    n/a
  • TensorFlow installed from (source or binary):
    binary
  • TensorFlow version (use command below):
    '2.0.0-preview' / "b'v1.12.0-6503-g7cfe43a11d'"
  • Python version:
    Python 3.6.7
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: No
  • GPU model and memory: No

You can collect some of this information using our environment capture script
You can also obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" => this doesn't work, you mean tf.version.x

Describe the current behavior
Segmentation fault (core dumped)
Describe the expected behavior
prints result
Code to reproduce the issue

import numpy as np
import tensorflow as tf
record_defaults=np.zeros(5)    
parsed_fields = tf.io.decode_csv(tf.constant('1,2,3,4,5'), record_defaults)

Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

It's fine with either tf.constants for record defaults or plain string to decode, eg:

parsed_fields = tf.io.decode_csv('1,2,3,4,5', record_defaults)


Numpy version: 
numpy                     1.16.0          py36_blas_openblash1522bff_1000  [blas_openblas]  conda-forge
@ageron
Copy link
Contributor

ageron commented Feb 1, 2019

I can confirm that I could reproduce this issue on MacOSX 10.13.6, python 3.6.8, TF version 2.0.0-dev20190126, git version b'v1.12.0-6726-g5522d670af', installed using pip3 install -U tf-nightly-2.0-preview.

The decode_csv() function expects the record_defaults to be an array of tensors, so replacing np.zeros(5) with [tf.constant(0.)]*5 (or even with [0.]*5) solves the problem, but still segmentation faults should never happen.

@dynamicwebpaige dynamicwebpaige added type:bug Bug TF 2.0 Issues relating to TensorFlow 2.0 labels Feb 3, 2019
@jvishnuvardhan jvishnuvardhan added the comp:ops OPs related issues label Feb 17, 2019
@jvishnuvardhan jvishnuvardhan self-assigned this Feb 17, 2019
@jvishnuvardhan jvishnuvardhan added stat:awaiting response Status - Awaiting response from author stat:awaiting tensorflower Status - Awaiting response from tensorflower and removed stat:awaiting response Status - Awaiting response from author labels Mar 1, 2019
@ebrevdo
Copy link
Contributor

ebrevdo commented Jul 12, 2019

I can reproduce this on a recent nightly in eager mode. In graph mode, a shape inference check raises a safe failure exceptio.

@tensorflow-bot
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

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.0 Issues relating to TensorFlow 2.0 type:bug Bug
Projects
TensorFlow 2.0
  
Awaiting triage
Development

No branches or pull requests

5 participants