examples/asr/quantization/speech_to_text_quant_infer.py run error
State: closed | Pull request: no
Labels: name: bug

docker image:
nvcr.io/nvidia/nemo:1.0.0rc1

command:
python speech_to_text_quant_infer.py --asr_model ./QuartzNet15x5Base-En-max-16.nemo --dataset ./test.json --sensitivity --onnx

error:
W0621 12:00:53.572198 140041427298112 tensor_quantizer.py:280] Use Pytorch's native experimental fake quantization.
[NeMo W 2021-06-21 12:01:03 nemo_logging:349] /opt/conda/lib/python3.6/site-packages/torch/onnx/utils.py:1112: UserWarning: No names were found for specified dynamic axes of provided input.Automatically generated names will be applied to each dynamic axes of input audio_signal
      'Automatically generated names will be applied to each dynamic axes of input {}'.format(key))

[NeMo W 2021-06-21 12:01:03 nemo_logging:349] /opt/conda/lib/python3.6/site-packages/torch/onnx/utils.py:1112: UserWarning: No names were found for specified dynamic axes of provided input.Automatically generated names will be applied to each dynamic axes of input logprobs
      'Automatically generated names will be applied to each dynamic axes of input {}'.format(key))

[NeMo W 2021-06-21 12:01:03 nemo_logging:349] /opt/conda/lib/python3.6/site-packages/pytorch_quantization-2.1.0-py3.6-linux-x86_64.egg/pytorch_quantization/nn/modules/tensor_quantizer.py:285: TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
      inputs, amax.item() / bound, 0,

[NeMo W 2021-06-21 12:01:03 nemo_logging:349] /opt/conda/lib/python3.6/site-packages/pytorch_quantization-2.1.0-py3.6-linux-x86_64.egg/pytorch_quantization/nn/modules/tensor_quantizer.py:291: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
      quant_dim = list(amax.shape).index(list(amax_sequeeze.shape)[0])

Warning: Constant folding supported for only opsets 9, 10, and 11. Constant folding not applied.
Traceback (most recent call last):
  File "speech_to_text_quant_infer.py", line 202, in <module>
    asr_model.export('./quant.onnx', onnx_opset_version=13)
  File "/opt/conda/lib/python3.6/site-packages/nemo/core/classes/exportable.py", line 222, in export
    example_outputs=output_example,
  File "/opt/conda/lib/python3.6/site-packages/torch/onnx/__init__.py", line 230, in export
    custom_opsets, enable_onnx_checker, use_external_data_format)
  File "/opt/conda/lib/python3.6/site-packages/torch/onnx/utils.py", line 91, in export
    use_external_data_format=use_external_data_format)
  File "/opt/conda/lib/python3.6/site-packages/torch/onnx/utils.py", line 662, in _export
    _check_onnx_proto(proto)
RuntimeError: Unrecognized attribute: axis for operator QuantizeLinear

==> Context: Bad node spec: input: "encoder.encoder.0.mconv.0.conv.weight" input: "1001" input: "1003" output: "1004" name: "QuantizeLinear_9" op_type: "QuantizeLinear" attribute { name: "axis" i: 0 type: INT }


Any thoughts?