擅长:python、mysql、java
<p>你需要重塑图像,试试这个</p>
<pre><code>datagen = ImageDataGenerator(rescale=1./255, zoom_range=0.1, rotation_range=25, width_shift_range=0.1, height_shift_range=0.1, shear_range=0.1, horizontal_flip=True)
ite = datagen.flow_from_directory("Car Images", batch_size=1)
for i in range(9):
# define subplot
plt.subplot(330 + 1 + i)
# generate batch of images
batch = ite.next()
# convert to unsigned integers for viewing
image = batch[0].astype('uint8')
image = np.reshape(256,256,3)
# plot raw pixel data
plt.imshow(image)
# show the figure
plt.show()
</code></pre>