tensorflow / tensorflow/datasets
How to convert my tf.data.dataset into image and label arrays
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
I created a tf.data.dataset using the instructions on the keras.io documentation site.
dataset = tf.keras.preprocessing.image_dataset_from_directory(
directory,
labels="inferred",
label_mode="int",
class_names=None,
color_mode="rgb",
batch_size=32,
image_size=(32,32),
shuffle=True,
)
My file directory is organized into classes with jpg files inside.
I don't know how to convert dataset file into and x_train and y_train to use in my model since model.fit doesn't take in the tf datasets.
I would appreciate some help in understanding how to take dataset and create x_train and y_train
Environment information
Windows 10,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the keras.io documentation entry for image_dataset_from_directory and the model.fit entry point mentioned in the report. Determine whether the documentation clearly explains the expected dataset input and how it relates to x_train and y_train, then update the relevant guidance so the conversion workflow and completion criteria are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- data, machine-learning
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100