Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

量化ch_PP-OCRv4_det后导出报错 #1884

Open
aijim opened this issue Jul 18, 2024 · 2 comments
Open

量化ch_PP-OCRv4_det后导出报错 #1884

aijim opened this issue Jul 18, 2024 · 2 comments
Assignees

Comments

@aijim
Copy link

aijim commented Jul 18, 2024

环境:
Ubantu 20.04
paddlepaddle-gpu 2.6.1
paddleslim 2.3.2

你好!
我用quant.py量化ch_PP-OCRv4_det后,用export_model.py导出模型的时候出错。好像是每层Conv2D都加了一层MAOutputScaleLayer,而export_model.py期望不加MAOutputScaleLayer的Conv2D层。有解决的方法么?

Traceback (most recent call last):
  File "/home/shui/ascent-paddleocr/deploy/slim/quantization/export_model.py", line 179, in <module>
    main()
  File "/home/shui/ascent-paddleocr/deploy/slim/quantization/export_model.py", line 173, in main
    export_single_model(model, arch_config, save_path, logger, input_shape,
  File "/home/shui/ascent-paddleocr/tools/export_model.py", line 196, in export_single_model
    layer.rep()
  File "/home/shui/ascent-paddleocr/ppocr/modeling/backbones/rec_lcnetv3.py", line 201, in rep
    kernel, bias = self._get_kernel_bias()
  File "/home/shui/ascent-paddleocr/ppocr/modeling/backbones/rec_lcnetv3.py", line 220, in _get_kernel_bias
    kernel_conv_1x1, bias_conv_1x1 = self._fuse_bn_tensor(self.conv_1x1)
  File "/home/shui/ascent-paddleocr/ppocr/modeling/backbones/rec_lcnetv3.py", line 244, in _fuse_bn_tensor
    kernel = branch.conv.weight
  File "/home/shui/.local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1657, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'MAOutputScaleLayer' object has no attribute 'weight'

@ArthurisYun
Copy link

我也遇到这问题 请问解决了么

@piupuer
Copy link

piupuer commented Nov 7, 2024

我也遇到这个问题, 用的是paddle3.0.0beta, paddleslim develop, paddleocr develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants