I created a dataset using my images:
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
dataset = tf.keras.preprocessing.image_dataset_from_directory(
<directory>,
label_mode=None,
seed=1,
subset='training',
validation_split=0.1,
image_size=(900, 900))
images = next(iter(dataset))
print(tf.shape(images))
I get the output: Found 209 files belonging to 1 classes. Using 189 files for training. tf.Tensor([ 32 900 900 3], shape=(4,), dtype=int32)
Now I want to look at one images with:
plt.imshow(images[19])
plt.show()
As output I get: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
And also a plain white image as an output.
I am sure that the images loaded into the dataset are not plain white. Can somebody help me?