try loading as TF SavedModel instead of HDF5

pull/91/head
Robert Sachunsky 2 years ago
parent a6fe781033
commit 79e897d3b2

@ -515,6 +515,9 @@ class Eynollah:
gpu_options = tf.compat.v1.GPUOptions(allow_growth=True) gpu_options = tf.compat.v1.GPUOptions(allow_growth=True)
#gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=7.7, allow_growth=True) #gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=7.7, allow_growth=True)
session = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options)) session = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options))
if model_dir.endswith('.h5') and Path(model_dir[:-3]).exists():
# prefer SavedModel over HDF5 format if it exists
model_dir = model_dir[:-3]
model = load_model(model_dir, compile=False) model = load_model(model_dir, compile=False)
return model, session return model, session

Loading…
Cancel
Save