1

I am using tensorflow 2.0.0. I want to inspect the contents of the datats, by extracting its contents and converting to numpy arrays (maybe there are other better ways to do so). Assume a dataset

<SkipDataset shapes: {features: (4,), label: ()}, types: {features: tf.float32, label: tf.int64}>

Then how to extract the features and label here inside the dataset?

1 Answer 1

1

You can do it using list like in here:

import tensorflow_datasets as tfds 
import tensorflow as tf

mnist = tfds.load(name="mnist", split=tfds.Split.TRAIN)
small = mnist.take(10)

print(list(small))

however be careful with that if your dataset is big.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.