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

Reading tfrecord reaches deadock or crushes in one computer and works just fine on another. #13039

Open
tnikolla opened this issue Sep 14, 2017 · 5 comments
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:contribution welcome Status - Contributions welcome

Comments

@tnikolla
Copy link

tnikolla commented Sep 14, 2017

Laptop -System information

  • Linux Ubuntu 16.04
  • TensorFlow installed with pip:
  • TensorFlow 1.3.0
  • Python 2.7.12
  • Spyder 2.3.8

Workstation -System information

  • Linux Ubuntu 16.04
  • TensorFlow installed with pip:
  • TensorFlow-gpu 1.0.0
  • Python 2.7.13

Problem description

I want to create and read a tfrecord file with build_cgd_dataset.py as the writer and reader_iter.py as the reader. Everything works smooth in the workstation but it reaches a deadlock or gets stuck in the laptop. The dataset are from Cornell grasping dataset.

I narrowed down the error in this special cases where it doesn't show any problem, for example:

  • if it reads a int64_list with one value, so a list with one elemnet
  • if it reads a float_list with one element

If the lists have more than one element the program freezes.

@reedwm
Copy link
Member

reedwm commented Sep 14, 2017

I could not reproduce on my workstation, after changing the paths in the programs to point to directories on my local workstation. To clarify, you are waiting for build_cgd_dataset.py to finish before starting reader_iter.py, right?

Try to reproduce the problem in a very simple case. Before, you were limiting the the number of elements in the lists, but instead try limiting the number of tf.train.Examples. Also try creating the tfrecords on your workstation and read them on the laptop, or vice versa. And try using the same TensorFlow versions on both, to see if the issue is caused by a certain TensorFlow version.

@reedwm reedwm added the stat:awaiting response Status - Awaiting response from author label Sep 14, 2017
@tnikolla
Copy link
Author

tnikolla commented Sep 15, 2017

So, I write the tfrecord with build_cgd_dataset.py. This works always. The problem lies in reading them.

I've done some more careful tests today. I'm writing here the programs:

writer.py

import tensorflow as tf

def _int64_feature(v):
    return tf.train.Feature(int64_list=tf.train.Int64List(value=v))

def _floats_feature(v):
    return tf.train.Feature(float_list=tf.train.FloatList(value=v))

def convert_to_example():
    return tf.train.Example(features=tf.train.Features(feature={
            'a': _floats_feature(a)}))

#a = [1, 2, 3]
a = [1., 2., 3.]
def main():
    writer = tf.python_io.TFRecordWriter('tfrecord_float')
    example = convert_to_example()
    writer.write(example.SerializeToString())
    writer.close()

if __name__ == '__main__':
    main()

reader.py

import tensorflow as tf

filename = '/home/tomi/issue/tfrecord_float'
record_iter = tf.python_io.tf_record_iterator(path=filename)
example = tf.train.Example()
for record in record_iter:
    example.ParseFromString(record)
    a = example.features.feature['a'].float_list.value[:]
    print(a)

Running the reader from the terminal (and not Spyder 2.3.8) everything works as should. Running the reader from Spyder reading a list of floats crushes Spyder. With a list of integers, more often than not, the reader works fine. Maybe the issue should be closed.

@aselle aselle removed the stat:awaiting response Status - Awaiting response from author label Sep 15, 2017
@reedwm
Copy link
Member

reedwm commented Sep 15, 2017

I also could not reproduce running from the terminal. You should verify that Spyder is using the same versions of Python and Tensorflow as when you run from the terminal.

Marking as contributions welcome if someone can reproduce in Spyder.

@reedwm reedwm added the stat:contribution welcome Status - Contributions welcome label Sep 15, 2017
@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Mar 28, 2023
@tilakrayal tilakrayal removed the stale This label marks the issue/pr stale - to be closed automatically if no activity label Aug 8, 2023
Copy link

github-actions bot commented Feb 5, 2024

This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:contribution welcome Status - Contributions welcome
Projects
None yet
Development

No branches or pull requests

4 participants