[Settings] tensorflow memory overhead

problem

Generally when you run tf, a single program often uses up all the memory block of the GPU.
But in fact, the program probably do not need such a big memory space.

improve proposals

By tf.ConfigProto().gpu_options.allow_growth=Truetelling the program, just take the actual memory required to:

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

If here the config.gpu_options.allow_growthset False, then the program will default to all memory fills entire card.

Published 628 original articles · won praise 863 · Views 1.85 million +

Guess you like

Origin blog.csdn.net/JNingWei/article/details/104848722