"The kernel appears to have died. It will restart automatically"问题

用jupyter notebook 运行教程中下面这个cell时,总会报"The kernel appears to have died. It will restart automatically"错误。

params = {
  'n_trees': 50,
  'max_depth': 3,
  'n_batches_per_layer': 1,
  # You must enable center_bias = True to get DFCs. This will force the model to 
  # make an initial prediction before using any features (e.g. use the mean of 
  # the training labels for regression or log odds for classification when
  # using cross entropy loss).
  'center_bias': True
}

est = tf.estimator.BoostedTreesClassifier(feature_columns, **params)
est.train(train_input_fn, max_steps=100)
results = est.evaluate(eval_input_fn)
pd.Series(results).to_frame()

在网上搜了一圈后,大致有两种原因:

  • OOM:OUT OF MEMORY
  • 软件版本不一致

但是基于训练数据只有30k, 627条,我首先排除了OOM的可能行,把可能相关的包更新了一遍,然而这个错还在。
最终在fast.ai论坛上找到了解决方法:

Alex.Nikitin Alexander
Hi! Had the same issue on AWS P2.xlarge. Choosing lower batch size from the beginning should help.

因为数据量小,源代码将所有数据直接作为一个batch,将batch_size改小后,it works for me too!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值