multi_object_datasets icon indicating copy to clipboard operation
multi_object_datasets copied to clipboard

Code in README.md doesn't work in other multi_dsprites_dataset

Open maestrojeong opened this issue 5 years ago • 1 comments

Code in 'README.md' works well in 'multi_dsprites_colored_on_colored.tfrecords'. However, it doesn't work well in 'multi_dsprites_binarized.tfrecords' and 'multi_dsprites_colored_on_grayscale.tfrecords'. In the code

  from multi_object_datasets import multi_dsprites
  import tensorflow as tf

  tf_records_path = 'path/to/multi_dsprites_binarized.tfrecords'
  batch_size = 32

  dataset = multi_dsprites.dataset(tf_records_path, 'binarized')
  batched_dataset = dataset.batch(batch_size)  # optional batching
  iterator = batched_dataset.make_one_shot_iterator()
  data = iterator.get_next()

  with tf.train.SingularMonitoredSession() as sess:
    d = sess.run(data)

, 'd=sess.run(data)' generates error,

tensorflow.python.framework.errors_impl.DataLossError: inflate() failed with error -3: incorrect header check
[[node IteratorGetNext ]]

The version of tensorflow is 1.14 as in README.md.

Thank you!!

Same error occurs in CLEVR code.

maestrojeong avatar Dec 06 '19 09:12 maestrojeong

Did you use the correct .py file for other datasets? For example, if you try to extract CLEVR, you need to use from multi_object_datasets import clevr_with_masks

yamand16 avatar Jun 28 '21 16:06 yamand16