mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-26 07:39:22 +02:00
ModelZoo.load_model: fix loading exported vs saved models
This commit is contained in:
parent
3de1407d18
commit
7f2bf715df
1 changed files with 1 additions and 2 deletions
|
|
@ -191,9 +191,8 @@ class EynollahModelZoo:
|
||||||
try:
|
try:
|
||||||
# avoid wasting VRAM on non-transformer models
|
# avoid wasting VRAM on non-transformer models
|
||||||
model = load_model(model_path, compile=False)
|
model = load_model(model_path, compile=False)
|
||||||
assert isinstance(model, KerasModel)
|
|
||||||
model.make_predict_function()
|
model.make_predict_function()
|
||||||
except ValueError:
|
except (AttributeError, ValueError):
|
||||||
model = tf.saved_model.load(model_path)
|
model = tf.saved_model.load(model_path)
|
||||||
model.predict_on_batch = model.serve
|
model.predict_on_batch = model.serve
|
||||||
model.input_shape = model.signatures.get('serving_default').inputs[0].shape
|
model.input_shape = model.signatures.get('serving_default').inputs[0].shape
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue