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

关于使用ONNX-QNN在生成Deploy模型出现的问题 #223

Closed
Zhoukai1234 opened this issue Dec 15, 2022 · 2 comments
Closed

关于使用ONNX-QNN在生成Deploy模型出现的问题 #223

Zhoukai1234 opened this issue Dec 15, 2022 · 2 comments
Labels

Comments

@Zhoukai1234
Copy link

您好,非常感谢您的出色工作。我是MQBench的初学者,在使用您mqbench的QNN方案对vgg19模型进行量化时,我发现当我使用以下config的时候,生成的onnx模型无法进行下一步的模型转换,也就是去除伪量化块,生成Deploy模型。请问这样的问题该如何解决?

            extra_qconfig_dict = {
                'w_observer': 'ClipStdObserver',
                'a_observer': 'ClipStdObserver',
                'w_fakequantize': 'DSQFakeQuantize',
                'a_fakequantize': 'DSQFakeQuantize',
                'w_qscheme': {
                    'bit': 8,
                    'symmetry': True,
                    'per_channel': False,
                    'pot_scale': True
                },
                'a_qscheme': {
                    'bit': 8,
                    'symmetry': True,
                    'per_channel': False,
                    'pot_scale': True
                }
            }
            prepare_custom_config_dict = {
                'extra_qconfig_dict': extra_qconfig_dict
            }
           self.model = prepare_by_platform(self.model, BackendType.ONNX_QNN, prepare_custom_config_dict)

报错信息如下

  File "openpose_mqb.py", line 411, in train
    convert_deploy(self.model, BackendType.ONNX_QNN, input_shape, model_name = 'model_QNN')
  File "MQBench-0.0.6-py3.9.egg/mqbench/convert_deploy.py", line 184, in convert_deploy
    convert_function(deploy_model, **kwargs)
  File "MQBench-0.0.6-py3.9.egg/mqbench/convert_deploy.py", line 138, in deploy_qparams_tvm
    ONNXQNNPass(onnx_model_path).run(model_name)
  File "MQBench-0.0.6-py3.9.egg/mqbench/deploy/deploy_onnx_qnn.py", line 273, in run
    self.format_qlinear_dtype_pass()
  File "MQBench-0.0.6-py3.9.egg/mqbench/deploy/deploy_onnx_qnn.py", line 258, in format_qlinear_dtype_pass
    scale, zero_point, qmin, qmax = node.input[1], node.input[2], node.input[3], node.input[4]
IndexError: list index (3) out of range
@Zhoukai1234
Copy link
Author

同时我也想向您请教,如果使用Academic方案,该如何实现支持TVM编译的depoly model的转换?

@github-actions
Copy link

This issue has not received any updates in 120 days. Please reply to this issue if this still unresolved!

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

No branches or pull requests

1 participant