config_tf = tf.ConfigProto() config_tf.gpu_options.per_process_gpu_memory_fraction = p