内部:无法使用以下模型配置调用thenRnnForward:[rnn_mode,rnn_input_mode,rnn_direction_mode]

我基于CuDDNLSTM层的神经网络给出了我无法正确理解的错误。训练大约30分钟后,错误随机弹出。完整的错误是:

InternalError: 2 root error(s) found.
  (0) Internal: Failed to call ThenRnnForward with model config: [rnn_mode,rnn_input_mode,rnn_direction_mode]: 2,[num_layers,input_size,num_units,dir_count,max_seq_length,batch_size]: [1,32,1,700,32] 
     [[{{node cu_dnnlstm_4/CudnnRNN}}]]
     [[loss_2/mul/_145]]
  (1) Internal: Failed to call ThenRnnForward with model config: [rnn_mode,32] 
     [[{{node cu_dnnlstm_4/CudnnRNN}}]]
0 successful operations.
0 derived errors ignored.

模型的摘要如下:

model = Sequential()
model.add(CuDNNLSTM(32,input_shape=(lengtharray,1),return_sequences=True))
model.add(Dropout(0.2))
model.add(CuDNNLSTM(32))
model.add(Dropout(0.2))
model.add(Dense(1,activation='sigmoid'))
model.compile(loss='binary_crossentropy',model.summary()
history = model.fit(X_train,y_train,epochs=50,validation_split = 0.1,shuffle=True,batch_size = 32,callbacks=callbacks_list)

_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
cu_dnnlstm_3 (CuDNNLSTM)     (None,32)           4480      
_________________________________________________________________
dropout_1 (Dropout)          (None,32)           0         
_________________________________________________________________
cu_dnnlstm_4 (CuDNNLSTM)     (None,32)                8448      
_________________________________________________________________
dropout_2 (Dropout)          (None,32)                0         
_________________________________________________________________
dense_1 (Dense)              (None,1)                 33        
=================================================================
Total params: 12,961
Trainable params: 12,961
Non-trainable params: 0

我知道这可能是内存限制问题。但是,当我使用10%的数据时,在用400个历元使用完全相同的参数进行训练时,该模型没有出错。我最初使用了大约7000个样本,而当我使用了大约75,000个样本时,就会发生错误。

输入向量的长度相同,并且批大小等相同。当使用更多样本而不是样本量较小时,模型崩溃的原因是什么?我正在运行RTX2070super。

wangjihong0407 回答:内部:无法使用以下模型配置调用thenRnnForward:[rnn_mode,rnn_input_mode,rnn_direction_mode]

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3121826.html

大家都在问