Skip to content

Commit

Permalink
fix export bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-jiaxuan committed Jan 9, 2025
1 parent bd9cfe8 commit 7c4bbc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ppocr/utils/export_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def dump_infer_config(config, path, logger):
common_dynamic_shapes = {
"x": [[1, 3, 32, 32], [1, 3, 64, 448], [8, 3, 488, 488]]
}
elif arch_config["algorithm"] == "SLANeXt":
common_dynamic_shapes = {
"x": [[1, 3, 512, 512], [1, 3, 512, 512], [8, 3, 512, 512]]
}
elif arch_config["algorithm"] == "LaTeXOCR":
common_dynamic_shapes = {
"x": [[1, 3, 224, 224], [1, 3, 448, 448], [8, 3, 1280, 1280]]
Expand Down Expand Up @@ -251,7 +255,7 @@ def dynamic_to_static(model, arch_config, logger, input_shape=None):
model = paddle.jit.to_static(
model,
input_spec=[
paddle.static.InputSpec(shape=[-1, 1, 512, 512], dtype="float32")
paddle.static.InputSpec(shape=[-1, 3, 512, 512], dtype="float32")
],
full_graph=True,
)
Expand Down

0 comments on commit 7c4bbc3

Please sign in to comment.