Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 内部:无法使用模型配置调用rnn前进:[rnn_模式、rnn_输入模式、rnn_方向模式]_Python_Keras - Fatal编程技术网

Python 内部:无法使用模型配置调用rnn前进:[rnn_模式、rnn_输入模式、rnn_方向模式]

Python 内部:无法使用模型配置调用rnn前进:[rnn_模式、rnn_输入模式、rnn_方向模式],python,keras,Python,Keras,我的基于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, 0, 0 , [num_layers, input_size, num_u

我的基于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, 0, 0 , [num_layers, input_size, num_units, dir_count, max_seq_length, batch_size]: [1, 32, 32, 1, 700, 32] 
     [[{{node cu_dnnlstm_4/CudnnRNN}}]]
     [[loss_2/mul/_145]]
  (1) Internal: Failed to call ThenRnnForward with model config: [rnn_mode, rnn_input_mode, rnn_direction_mode]: 2, 0, 0 , [num_layers, input_size, num_units, dir_count, max_seq_length, batch_size]: [1, 32, 32, 1, 700, 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, 700, 32)           4480      
_________________________________________________________________
dropout_1 (Dropout)          (None, 700, 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