小编Mah*_*jah的帖子

Keras ImageDataGenerator: problem with data and label shape

I wanted to generate more images using Keras as you can see in here, using this code (almost the same as source>Random Rotations):

# Random Rotations
from keras.datasets import mnist
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot
from keras import backend as K
datagen = ImageDataGenerator(rotation_range=90)
# fit parameters from data
datagen.fit(cats["images"])

print(np.asarray(cats["label"]).shape)  #output=(12464,)
print(np.asarray(cats["images"]).shape) #output=(12464, 60, 60, 1)

# configure batch size and retrieve one batch of images
for X_batch, y_batch in datagen.flow(cats["images"], cats["label"], batch_size=9):
    # …
Run Code Online (Sandbox Code Playgroud)

python image-processing keras tensorflow

1
推荐指数
1
解决办法
1374
查看次数

标签 统计

image-processing ×1

keras ×1

python ×1

tensorflow ×1