From 98109b0e193468df50e72da0135129f9d2e5c2f9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 31 Mar 2022 16:31:14 +0200 Subject: [PATCH] SavedModel TF Serve Fix Fix for https://github.com/ultralytics/yolov5/issues/7205 proposed by @tylertroy --- export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export.py b/export.py index 7517dc4678da..0404b2585a1d 100644 --- a/export.py +++ b/export.py @@ -276,7 +276,7 @@ def export_saved_model(model, im, file, dynamic, m = m.get_concrete_function(spec) frozen_func = convert_variables_to_constants_v2(m) tfm = tf.Module() - tfm.__call__ = tf.function(lambda x: frozen_func(x)[0], [spec]) + tfm.__call__ = tf.function(lambda x: frozen_func(x)[:4], [spec]) tfm.__call__(im) tf.saved_model.save( tfm,