求助 pycharm跑模型转换一直报错

Viewed 90

问题描述


该安装的我都按照了,但是一直报已成功加载 site-packages DLL 路径: D:\anaconda3\envs\k230\Lib\site-packages
❌ 依然报错,请复制新错误: DLL load failed while importing _nncase: 找不到指定的模块。
D:\Desktop\seam\pythonProject\test_yolo11\detect\to_kmodel.py:54: DeprecationWarning: mapping.TENSOR_TYPE_TO_NP_TYPE is now deprecated and will be removed in a future release.To silence this warning, please use helper.tensor_dtype_to_np_dtype instead.
input_dict['dtype'] = onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[onnx_type.elem_type]
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.
Traceback (most recent call last):
File "D:\Desktop\seam\pythonProject\test_yolo11\detect\to_kmodel.py", line 211, in
main()
File "D:\Desktop\seam\pythonProject\test_yolo11\detect\to_kmodel.py", line 127, in main
compile_options = nncase.CompileOptions()
NameError: name 'nncase' is not defined

复现步骤


球球了 救命

2 Answers

附注这位同学的解决办法:https://github.com/kendryte/nncase/issues/451 参考该issue;
下载libomp140.x86_64.zip,将解压后的dll文件添加到C:\Windows\System32目录下。

你是不是没有安装nncase-kpu包?或者你安装错位置了,没有安装在当前conda环境中?

(k230) PS D:\Desktop\seam\pythonProject> pip list | findstr nncase
nncase 2.9.0
nncase-kpu 2.9.0
我已经安装了

你pycharm配的应该不是这个k230的环境

在pycharm新增解释器,添加k230这个环境下的python解释器,不要用默认的,或者你直接在命令行运行