【问题标题】:My kernel keeps dying in jupyter notebook when i run fit function当我运行 fit 功能时,我的内核在 jupyter notebook 中一直死机
【发布时间】:2022-06-16 10:55:22
【问题描述】:

当我运行 fit 函数时,我的内核一直在死机 我的张量流版本 2.6.0

我已经重新安装了 jupyter notebook,升级了我的 pip,升级了我的 tensoflow 库, 添加了这一行

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

我的内核仍然死机

这是我尝试运行的代码

learning_rate_reduction = ReduceLROnPlateau(monitor = 'val_acc', patience = 3, verbose = 1, factor = .5, min_lr = .00001)

es = EarlyStopping(monitor='val_categorical_accuracy', patience = 4)

print('====')

history = model.fit_generator(generator = train_batches, steps_per_epoch = train_batches.n//batch_size, epochs=epochs, 
                    validation_data = val_batches, validation_steps = val_batches.n//batch_size, verbose = 0,
                    callbacks = [learning_rate_reduction, es])

【问题讨论】:

  • 很有可能由于内存不足而死亡。如果不了解模型、数据、使用的系统等细节,就不可能说更多。
  • 请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。

标签: machine-learning jupyter-notebook


【解决方案1】:

根据我的经验,您应该尝试其中一种

  1. 检查环境变量

    • 确保您有 CUDA_PATH
    • 确保在系统变量的 PATH 中写入 cuda/bin、cuda/include、cuda/lib/x64 的路径
  2. 通过在更小更简单的模型上训练网络来检查模型是否过于复杂

  3. 确保 anaconda 导航器已更新

  4. 根据我的经验,python 3.8.5 和 tensorflow 2.7 可以工作,可以在 anaconda navigator 的环境中下载

【讨论】:

    猜你喜欢
    • 2019-07-31
    • 2019-08-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-02
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    相关资源
    最近更新 更多