×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

寒武纪支持pytorch量化感知训练后的模型吗? 已解决 FrostLee2023-02-06 17:21:33 回复 4 查看 技术答疑 使用求助
寒武纪支持pytorch量化感知训练后的模型吗?
分享到:

【寒武纪硬件产品型号】必填*:MLU220


【使用操作系统】必填*:Ubuntu 18.04.5 LTS 


【使用驱动版本】必填*:CNRT: 4.10.2 adb709e


【问题】:经过pytorch量化感知训练后的模型,支持转换成MLU220离线模型吗?


【错误信息】:

Traceback (most recent call last):

  File "mlu_forward_qat.py", line 347, in <module>

    mlu_forward( opt.img, use_mlu=True, mlu220 = save_offline_model, fusion= opt.fusion)

  File "mlu_forward_qat.py", line 237, in mlu_forward

    model = mlu_quantize.quantize_dynamic_mlu(model)

  File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch_mlu/core/mlu_quantize.py", line 236, in quantize_dynamic_mlu

    model = copy.deepcopy(model)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 280, in _reconstruct

    state = deepcopy(state, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 150, in deepcopy

    y = copier(x, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 240, in _deepcopy_dict

    y[deepcopy(key, memo)] = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 306, in _reconstruct

    value = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 280, in _reconstruct

    state = deepcopy(state, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 150, in deepcopy

    y = copier(x, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 240, in _deepcopy_dict

    y[deepcopy(key, memo)] = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 306, in _reconstruct

    value = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 280, in _reconstruct

    state = deepcopy(state, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 150, in deepcopy

    y = copier(x, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 240, in _deepcopy_dict

    y[deepcopy(key, memo)] = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 180, in deepcopy

    y = _reconstruct(x, memo, *rv)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 306, in _reconstruct

    value = deepcopy(value, memo)

  File "/usr/local/python3.6/lib/python3.6/copy.py", line 169, in deepcopy

    rv = reductor(4)

  File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/nn/quantized/modules/conv.py", line 151, in __getstate__

    raise RuntimeError('torch.save() is not currently supported for quantized modules.'

RuntimeError: torch.save() is not currently supported for quantized modules. See https://github.com/pytorch/pytorch/issues/24045. Please use state_dict or torch.jit serialization.


版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭