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

 

你可能感兴趣的:(GPU)