Kmodel转换问题

Viewed 81

问题描述


我在使用:(pytorch) E:\PythonProject\SkinRecognition-2>python to_kmodel.py --target k230 --model "DermMobileNetV3_best-0.923.onnx" --dataset "test" --input_width 320 --input_height 320 --ptq_option 0
warn: Nncase.Hosting.PluginLoader[0]
NNCASE_PLUGIN_PATH is not set.
NNCASE_PLUGIN_PATH set to: D:\Anaconda\envs\pytorch\lib\site-packages\nncase
Simplifying ONNX model...
WARNING: The argument input_shapes is deprecated. Please use overwrite_input_shapes and/or test_input_shapes
instead. An error will be raised in the future.
Simplified model saved to: tmp\simplified.onnx
Creating compiler...
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'k230' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Nncase.Targets.TargetProvider.GetTarget(String name)
at Nncase.CompilerServicesProvider.GetTarget(String name)
at Nncase.Compiler.Interop.CApi.TargetCreate(Byte* targetNamePtr, UIntPtr targetNameLength)
转换不成功,提示nncasenncase 2.10.0不支持k230这个target,请问如何解决

2 Answers

你是不是没有安装nncase-kpu包?

安装了的,版本为2.10

请问nncase和nncase-kpu都是用的2.10.0吗?可以切换成2.9.0试试

我已经换成2.9.0了,然后执行转换又提示:
(nncase_v2) E:\PythonProject\ONNX-Kmodel>python to_kmodel.py --target k230 --model E:/PythonProject/ONNX-Kmodel/DermMobileNetV3_best-0.923.onnx --dataset E:/PythonProject/ONNX-Kmodel/test --input_width 320 --input_height 320 --ptq_option 2
Traceback (most recent call last):
File "E:\PythonProject\ONNX-Kmodel\to_kmodel.py", line 7, in
import nncase
File "D:\Anaconda\envs\nncase_v2\lib\site-packages\nncase_init_.py", line 34, in
import _nncase
ImportError: DLL load failed while importing _nncase: 找不到指定的模块。