tensorflow / fold

Deep learning with dynamic computation graphs in TensorFlow
Apache License 2.0
1.83k stars 266 forks source link

GPU memory growth failed #78

Open tadpole opened 7 years ago

tadpole commented 7 years ago

Hi, i use Allowing GPU memory growth like followings which worked well in tensorflow:

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config, ...)

But it still occupies all of the GPU memory of all GPUs in this project.

How can i fix it ?

pklfz commented 7 years ago

An temporary workaround is here below

import tensorflow as tf

tf_config = tf.ConfigProto()
tf_config.gpu_options.allow_growth = True
sess = tf.Session(config=tf_config, graph=None)

import tensorflow_fold as td

and then create another session with your graph and the same tf_config, like:

with tf.Session(config=tf_config, graph=your_graph) as sess:
    # your code for training or test

I think this is an inherent feature bug the owner should check and fix