From a6b96bbfb1a0bdac495b3fd2bfef2b09e1cb79b8 Mon Sep 17 00:00:00 2001 From: Liu Jiaxuan <85537209+liu-jiaxuan@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:21:34 +0800 Subject: [PATCH] fix SLANeXt export bug (#14512) * add slanext models * refine codes * refine codes * refine codes * fix export SLANeXt --- ppocr/utils/export_model.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ppocr/utils/export_model.py b/ppocr/utils/export_model.py index ccb4456eca..3394c20c79 100644 --- a/ppocr/utils/export_model.py +++ b/ppocr/utils/export_model.py @@ -241,6 +241,14 @@ def dynamic_to_static(model, arch_config, logger, input_shape=None): ], full_graph=True, ) + elif arch_config["algorithm"] == "SLANeXt": + model = paddle.jit.to_static( + model, + input_spec=[ + paddle.static.InputSpec(shape=[-1, 1, 512, 512], dtype="float32") + ], + full_graph=True, + ) elif arch_config["algorithm"] == "PP-FormulaNet-L": model = paddle.jit.to_static( model,