ImageDataGenerator批处理大小问题

时间:2019-03-28 10:41:34

标签: python keras

我想使用ImageDataGenerator将图像分为几批,但似乎并没有将图像拆分。

我基本上只是想将图像分成小批。 (一直在给我一个Segfault错误...)我尝试使用.flow(batch_size = 32,..),但它似乎并未将图像分割成多个小批。

代码:


if __name__ == '__main__':
    y = model_build()
    y.compile(loss = "mean_squared_error", optimizer = 'adam')
    gen = keras.preprocessing.image.ImageDataGenerator()
    batches = 0
    for x_batch in gen.flow(x=env(False), batch_size=32):
        batches += 1
        print(x_batch.shape)
        y.fit(x_batch, y = np.array([[0,0,0,0]]))
        if batches >= len(env())/32:
             break
    print("Tested rewarder...")
    y.summary()

0 个答案:

没有答案
相关问题