mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-09 12:19:54 +02:00
try loading as TF SavedModel instead of HDF5
This commit is contained in:
parent
a6fe781033
commit
79e897d3b2
1 changed files with 3 additions and 0 deletions
|
@ -515,6 +515,9 @@ class Eynollah:
|
|||
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)
|
||||
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)
|
||||
|
||||
return model, session
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue