Jupyter notebook Tensorflow GPU Memory 释放
2017-12-13 02:27
603 查看
Jupyter notebook 每次运行完tensorflow的程序,占着显存不释放。而又因为tensorflow是默认申请可使用的全部显存,就会使得后续程序难以运行。暂时还没有找到在jupyter notebook里面自动释放显存的方法,但是我们可以做的是通过指定config为使用的显存按需自动增长,这样可以避免大多数的问题。代码如下:
参考链接: http://blog.csdn.net/leibaojiangjun1/article/details/53671257
gpu_no = '0' # or '1' os.environ["CUDA_VISIBLE_DEVICES"] = gpu_no # 定义TensorFlow配置 config = tf.ConfigProto() # 配置GPU内存分配方式,按需增长,很关键 config.gpu_options.allow_growth = True # 配置可使用的显存比例 config.gpu_options.per_process_gpu_memory_fraction = 0.1 # 在创建session的时候把config作为参数传进去 sess = tf.InteractiveSession(config = config)
参考链接: http://blog.csdn.net/leibaojiangjun1/article/details/53671257
相关文章推荐
- 用Docker在Ubuntu下 设置一个完整的Python + TensorFlow + GPU support + jupyter notebook + Deep Learning 开发环境
- 在jupyter notebook导入tensorflow出错:No module named tensorflow 解决办法
- 基于Anaconda的tensorflow/jupyter notebook/numpy/matplotlib/scipy的安装
- VPS搭建Tensorflow Jupyter Notebook 教程
- 解决Jupyter notebook[import tensorflow as tf]报错
- win7系统 深度学习环境 anaconda+tensorflow+jupyter notebook轻松搭建
- Jupyter notebook import tensorflow as tf 出错
- 深度学习环境搭建:linux下 Ubuntu16.04+cuda8.0+cudnn+anaconda+tensorflow并配置远程访问jupyter notebook
- 深度学习环境搭建:linux下 Ubuntu16.04+cuda8.0+cudnn+anaconda+tensorflow并配置远程访问jupyter notebook
- Ubuntu 下google chrome 打开jupyter notebook 报错ERROR:browser_gpu_channel_host_factory.cc(120)] Failed to
- Windows10 GPU版Tensorflow配置教程+Anaconda3+Jupyter Notebook
- Ubuntu+Anaconda+TensorFlow+opencv+Python +jupyter+matplotlib+pillow安装
- jupyter notebook MemoryErrory
- jupyter tensorflow配置
- Ubuntu14.04安装Anaconda+tensorflow+jupyter
- 远程使用内网服务器的tensorboard和jupyter notebook
- 一句话创建Jupyter For TensorFlow
- jupyter+tensorflow实现图像的风格转移(style-transfer)
- Jupyter notebook安装使用中的问题
- windows 子系统 linux (WLS):jupyter notebook 安装