jupyter notebook中使用tensorflow-gpu常常出现的问题

问题1:

Kernel Restarting The kernel appears to have died. It will restart automatically

解决方法:

如果是在装有GPU的服务器上搭建的jupyter notebook,并且使用的tensorflow可以通过在session的前面加上config来解决这个问题,亲自试过可行(我觉得主要问题是在此之前都是在cpu上运行的程序,造成内存不足,所以导致的kernel died,如果查看在代码运行的时候内存占用情况可以使用free -h):

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)

问题2:

WARNING:tensorflow:From /root/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/layers/core.py:143: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.Instructions for updating: Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.

WARNING:tensorflow:From /root/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.Instructions for updating: Use tf.cast instead.

WARNING:tensorflow:From /root/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/math_grad.py:102: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Deprecated in favor of operator or tf.math.divide.

解决方法:

发生这种问题的主要原因可能是anaconda版本问题,或者是其他版本问题造成的版本不兼容。使用以下指令进行相应的更新。亲自尝试可行。

conda update mkl
conda upgrade notebook
conda upgrade jupyter
conda update anaconda

 

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值