【问题标题】:[_Derived_]RecvAsync is cancelled[_Derived_]RecvAsync 被取消
【发布时间】:2020-09-17 23:32:34
【问题描述】:

我已经有这个错误了,我已经改了好几个,epochs = 100, 50,我已经改了batch_size,我改了TensorFlow版本。但是我仍然无法解决这个问题。 我正在使用谷歌 colab。

谁能帮帮我?

model1 = Sequential()
model1.add(LSTM(units = 15, return_sequences = True, input_shape=(2167290, 15)))
model1.add(Dropout(0.3))

model1.add(LSTM(units = 150, return_sequences = True))
model1.add(Dropout(0.3))

model1.add(LSTM(units = 100, return_sequences = True))
model1.add(Dropout(0.3))

model1.add(LSTM(units = 50, return_sequences = True))
model1.add(Dropout(0.3))

# Camada Final
model1.add(Dense(1, activation='sigmoid'))

# Compile model
model1.compile(optimizer = 'Adam', loss = 'mean_squared_error',
                  metrics=['accuracy', 'AUC', 'Recall', 'Precision'])
# Fit the model
model1.fit(x_train,y_train, epochs=20, batch_size=32, validation_data=(x_test, y_test))

它正在产生这个错误。

Epoch 1/20
---------------------------------------------------------------------------
CancelledError                            Traceback (most recent call last)
<ipython-input-17-c4f437a21b09> in <module>()
     19                   metrics=['accuracy', 'AUC', 'Recall', 'Precision'])
     20 # Fit the model
---> 21 model1.fit(x_train,y_train, epochs=20, batch_size=32, validation_data=(x_test, y_test))

8 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     58     ctx.ensure_initialized()
     59     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60                                         inputs, attrs, num_outputs)
     61   except core._NotOkStatusException as e:
     62     if name is not None:

CancelledError:  [_Derived_]RecvAsync is cancelled.
     [[{{node ConstantFolding/assert_greater_equal_2/Assert/AssertGuard/switch_pred/_58_const_false/_113}}]] [Op:__inference_train_function_11454]

Function call stack:
train_function

【问题讨论】:

    标签: python tensorflow keras deep-learning lstm


    【解决方案1】:

    我遇到了同样的错误,我将 LSTM 层数从 75 减少到 10 并且它起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-10
      • 2013-01-08
      • 1970-01-01
      • 2014-01-12
      • 2013-04-11
      • 2020-06-29
      • 2016-04-07
      • 1970-01-01
      相关资源
      最近更新 更多