From 7d832ac3f06fcb470f0a5089f6ad2d7f787dde76 Mon Sep 17 00:00:00 2001 From: xiaoting <31891223+tink2123@users.noreply.github.com> Date: Wed, 8 Jun 2022 19:46:50 +0800 Subject: [PATCH] fix export and kie backbone (#6526) --- ppocr/modeling/backbones/kie_unet_sdmgr.py | 7 +------ tools/export_model.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ppocr/modeling/backbones/kie_unet_sdmgr.py b/ppocr/modeling/backbones/kie_unet_sdmgr.py index 793c68c6..4b1bd803 100644 --- a/ppocr/modeling/backbones/kie_unet_sdmgr.py +++ b/ppocr/modeling/backbones/kie_unet_sdmgr.py @@ -176,11 +176,6 @@ class Kie_backbone(nn.Layer): x = self.img_feat(img) boxes, rois_num = self.bbox2roi(gt_bboxes) feats = paddle.vision.ops.roi_align( - x, - boxes, - spatial_scale=1.0, - pooled_height=7, - pooled_width=7, - rois_num=rois_num) + x, boxes, spatial_scale=1.0, output_size=7, boxes_num=rois_num) feats = self.maxpool(feats).squeeze(-1).squeeze(-1) return [relations, texts, feats] diff --git a/tools/export_model.py b/tools/export_model.py index c0cbcd36..3ea0228f 100755 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -76,7 +76,7 @@ def export_single_model(model, arch_config, save_path, logger, quanter=None): else: infer_shape = [3, -1, -1] if arch_config["model_type"] == "rec": - infer_shape = [3, 32, -1] # for rec model, H must be 32 + infer_shape = [3, 48, -1] # for rec model, H must be 32 if "Transform" in arch_config and arch_config[ "Transform"] is not None and arch_config["Transform"][ "name"] == "TPS": -- GitLab