google-colaboratory - Keras model.fit 模型训练期间缓冲数据在 google colab 中被截断

标签 google-colaboratory

使用 Keras.model.fit 训练模型时,我遇到“缓冲数据在达到输出大小限制后被截断”的情况。在输出中,并且输出不再更新。

Epoch 14/30
    51/721 [=>............................] - ETA: 27s - loss: 0.7874 - dense_6_loss: 0.4921 - dense_7_loss: 0.1440 - dense_8_loss: 0.1513 - dense_6_accuracy: 0.8556 - dense_7_accuracy: 0.9532 - dense_8_accuracy: 0.9511Buffered data was truncated after reaching the output size limit.

这似乎是某种内存错误 Buffered data was truncated after reaching the output size limit

尽管文本量保持不变。

最佳答案

我对 epochs=100batch_size=1 也有同样的问题。当我将 keras 详细程度设置为 2 时,问题就解决了。要保存在 stdout 中获得的学习结果,您只需使用 logger 即可,如下所示:

from keras.callbacks import CSVLogger
csv_logger = CSVLogger(
        "log.csv",
        append=True,
        separator=','
    )
history = model.fit(
        x_train,
        y_train,
        batch_size=batch_size,
        epochs=epochs,
        verbose=2,
        validation_data=(x_test, y_test),
        callbacks=[csv_logger]
    )

关于google-colaboratory - Keras model.fit 模型训练期间缓冲数据在 google colab 中被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59720106/

相关文章:

python - Graphviz 不在 Colab 上打印输出图

google-colaboratory - 在 Google Colab 中删除 80 个字符处的行

tensorflow - 在 Google Colab 中使用多个 GPU 在 Tensorflow 中进行分布式训练

python - 在 Flask 应用程序中从 Jupyter Notebook 中 Unpickle 实例

python - 如何使用保存的模型在 google colab 中恢复训练?

python - 如何在google colaboratory中上传数据集?

python-3.x - Colab 中的 RAPIDS 属性错误 : module 'cudf' has no attribute '_lib'

python - 在 Google Colab 的 shell 脚本中连接命令字符串

python - 使用计算机中的驱动器地址进入 google colab

google-cloud-platform - 如何查看您的 GoogleColab 运行的区域?