How to fix “ResourceExhaustedError: OOM when allocating tensor”

前端 未结 3 1813
独厮守ぢ
独厮守ぢ 2021-01-03 01:31

I wanna make a model with multiple inputs. So, I try to build a model like this.

# define two sets of inputs
inputA = Input(shape=(32,64,1))
inputB = Input(sh         


        
3条回答
  •  被撕碎了的回忆
    2021-01-03 01:55

    From [800000,32,30,62] it seems your model put all the data in one batch.

    Try specified batch size like

    history = model.fit([trainimage, train_product_embd],train_label, validation_data=([validimage,valid_product_embd],valid_label), epochs=10, steps_per_epoch=100, validation_steps=10, batch_size=32)
    

    If it still OOM then try reduce the batch_size

提交回复
热议问题