Iterating dataset as numpy with batch_size > 1 failed to work.
See original GitHub issueShort description
When I loaded a dataset (cifar10) with batch_size set to larger than 1, converted it to a generator with tfds.as_numpy
and tried to iterate over the generator, I got the following repeated warning and no data:
2019-03-26 10:09:57.170947: W tensorflow/core/framework/model.cc:419] Failed to find a tunable parameter that would decrease the output time, aborting the current optimization attempt.
Environment information
- Operating System: Mac OSX
- Python version: 2.7
tensorflow-datasets
/tfds-nightly
version: 1.0.1tensorflow
/tensorflow-gpu
/tf-nightly
/tf-nightly-gpu
version: 1.13.1
Reproduction instructions
import tensorflow_datasets as tfds
BATCH_SIZE = 5
dataset = tfds.load('cifar10', as_supervised=True, split=tfds.Split.TEST, batch_size=BATCH_SIZE)
npds = tfds.as_numpy(dataset)
for image, label in npds:
print(image.shape, label)
Expected behavior
The generator npds
should return batches of data with the same batch size as dataset
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
tensorflow dataset API doesn't work stably when batch size is ...
When I call read_batch_DatasetAPI with batch_size = 1 (see the code below), it can process all (around 200,000) Sequence Examples one-by-one ...
Read more >How to use Different Batch Sizes when Training and ...
The training batch size will cover the entire training dataset (batch learning) and predictions will be made one at a time (one-step prediction) ......
Read more >Training & evaluation with the built-in methods - Keras
Introduction. This guide covers training, evaluation, and prediction (inference) models when using built-in APIs for training & validation ...
Read more >How to use Dataset and Iterators in Tensorflow with code ...
One-shot iterator will iterate through all the elements present in Dataset and once exhausted, cannot be used anymore.
Read more >tf.keras.Sequential | TensorFlow v2.11.0
Trains the model for a fixed number of epochs (iterations on a dataset). ... in your dataset divided by the batch size, or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try this instead:
I had another strange problem with the batch_size argument. The latest update made my old problem go away, but then I saw the same problem as you.
I’m using python 3.7 and tf2.0 nightly