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

Onnx.dll error and PermissionError #8

Open
Liyulingyue opened this issue Sep 21, 2024 · 1 comment
Open

Onnx.dll error and PermissionError #8

Liyulingyue opened this issue Sep 21, 2024 · 1 comment

Comments

@Liyulingyue
Copy link

我在使用相关脚本/命令时遇到了一些问题。这可能是我们仓库的一些疏忽导致的,或者应当向其他开发团队提交Issue(如果可以的话,请帮忙指个路~谢谢),罗列如下

  • 开发环境:
    • 13th Gen Intel(R) Core(TM) i7-13700K 3.40 GHz
    • Windows 11 x64
    • Python 3.12.5

Onnx不兼容的问题

在其他仓库,例如ChatGLM.ov同样出现了此问题。

安装requirements.txt后会自动安装 onnx==1.16.2,产生如下报错

RuntimeError: Failed to import optimum.intel.openvino because of the following error (look up to see its traceback):
Failed to import optimum.onnx.graph_transformations because of the following error (look up to see its traceback):
DLL load failed while importing onnx_cpp2py_export: 动态链接库(DLL)初始化例程失败。

解决方案为降级为1.16.1

.bin占用

当convert.py 运行至

    print("====Exporting IR tokenizer=====")
    from optimum.exporters.openvino.convert import export_tokenizer
    export_tokenizer(tokenizer, ir_model_path)

会warning

Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python312\Lib\shutil.py", line 633, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\tmp0z2q3zs8\\openvino_model.bin'

不影响最后获取完整的导出文件,但这应当是个问题,需要解决一下

推文

我很高兴看到推文 https://mp.weixin.qq.com/s/GyWRyw64kHA6iob07r6FHQ 给出了最新的关于2.5的介绍,但实际上推文中optimum-cli同样需要基于onnx 1.16.1才能运行。

此外,推文中对于命令行指令的书写存在一处错误,在'qwen/Qwen2.5-7B-Instruct '中增加了一个空格,有碍于运行。(仅仅是因为推文引流到此仓库所以在这里说一下)

@openvino-dev-samples
Copy link
Owner

@Liyulingyue 感谢你的反馈,目前该项目在Python3.12没有得到验证,请尽量尝试用3.8 - 3.11版本尝试。

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