kaknikhil commented on a change in pull request #443: DL: Add training for
multiple models
URL: https://github.com/apache/madlib/pull/443#discussion_r325837032
##########
File path: src/ports/postgres/modules/deep_learning/madlib_keras_wrapper.py_in
##########
@@ -79,6 +79,21 @@ def set_keras_session(device_name, gpus_per_host,
segments_per_host):
session = K.tf.Session(config=config)
K.set_session(session)
+def get_keras_session(device_name, gpus_per_host, segments_per_host):
+ config = K.tf.ConfigProto()
+ if gpus_per_host > 0:
+ memory_fraction = get_gpu_memory_fraction(gpus_per_host,
segments_per_host)
+ config.gpu_options.allow_growth = False
+ config.gpu_options.per_process_gpu_memory_fraction = memory_fraction
+ session = tf.Session(config=config)
Review comment:
1. is there a reason we are using `tf.Session` instead of `K.tf.Session()`.
1. Most of the code in get_keras_session and set_keras_session is the same.
Can we reuse ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services