【问题标题】:Kernel Died when plotting CNN learning history绘制 CNN 学习历史时内核死亡
【发布时间】:2022-10-24 12:08:00
【问题描述】:

我正在使用 keras 创建一个 CNN。一切都被罚款,直到我尝试绘制学习历史 该模型。

# Train the CNN
history = model.fit_generator(train_generator, steps_per_epoch = 143, epochs = 20, validation_data = validation_generator, validation_steps = 18)

# Display the loss and accuracy during training
acc = history['acc']
val_acc = history['val_acc']
loss = history['loss']
val_loss = history['val_loss']
epochs = range(1,len(acc) + 1)

为绘图准备数据后,我编写了以下代码:

plt.plot(epochs, acc, 'bo', label = 'Training acc')
plt.plot(epochs, val_acc, 'b', label = 'Validation acc')
plt.title('Training and validation accuracy')
plt.legend()
plt.figure()
plt.plot(epochs, loss, 'bo', label='Training loss')
plt.plot(epochs, val_loss, 'b', label='Validation loss')
plt.title('Training and validation loss')
plt.legend()
plt.show()

然后 Jupyter Notebook 告诉我'内核似乎已经死了。它会自动重启'

【问题讨论】:

    标签: python keras deep-learning


    【解决方案1】:

    我已经解决了这个问题。将 python 和 tensorflow 分别更新到 3.9 和 2.10。

    【讨论】:

      猜你喜欢
      • 2021-06-19
      • 2016-12-23
      • 2017-04-08
      • 2011-09-08
      • 1970-01-01
      • 1970-01-01
      • 2022-11-27
      • 2020-04-06
      • 2020-02-28
      相关资源
      最近更新 更多