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

pytorch qat模型转rknn模型报错 KeyError: 'scale' #467

Open
CuberFan opened this issue Aug 15, 2024 · 2 comments
Open

pytorch qat模型转rknn模型报错 KeyError: 'scale' #467

CuberFan opened this issue Aug 15, 2024 · 2 comments

Comments

@CuberFan
Copy link

CuberFan commented Aug 15, 2024

pytorch:1.10.0
rknn_toolkit: 1.7.5
转换环境:官方1.7.5的docker

错误:
E Catch exception when loading pytorch model: ./ocr_ht_waferlabel/resnet18v1_ocr_det_qat_script_best.pt!
E Traceback (most recent call last):
E File "rknn/base/RKNNlib/app/importer/import_pytorch.py", line 131, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E File "rknn/base/RKNNlib/converter/convert_pytorch_new.py", line 5245, in rknn.base.RKNNlib.converter.convert_pytorch_new.convert_pytorch.load
E File "rknn/base/RKNNlib/converter/convert_pytorch_new.py", line 5419, in rknn.base.RKNNlib.converter.convert_pytorch_new.convert_pytorch.parse_nets
E File "rknn/base/RKNNlib/converter/convert_pytorch_new.py", line 5033, in rknn.base.RKNNlib.converter.convert_pytorch_new.PyTorchOpConverter.convert_operators
E File "rknn/base/RKNNlib/converter/convert_pytorch_new.py", line 4673, in rknn.base.RKNNlib.converter.convert_pytorch_new.PyTorchOpConverter.quantized_linear
E KeyError: 'scale'
E Please feedback the detailed log file <covert2rknn.log> to the RKNN Toolkit development team.
E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues

相同的模型,1.7.3的docker转换没有任何报错,用1.7.5的docker报上面的错误 KeyError: 'scale'

pytorch 1.9.0 + rknn toolkit 1.7.5,同样报上述错误。

基本可以确定是rknn toolkit 1.7.5的 bug

@jxx-xi
Copy link

jxx-xi commented Aug 27, 2024

发个模型来验证一下吧

@CuberFan
Copy link
Author

CuberFan commented Sep 7, 2024

发个模型来验证一下吧

好的,现在上传模型。
Uploading model.zip…

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

2 participants