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)初始化例程失败 问题 #348

Closed
Atul-8 opened this issue Dec 26, 2024 · 1 comment
Closed

关于 onnx 动态链接库(DLL)初始化例程失败 问题 #348

Atul-8 opened this issue Dec 26, 2024 · 1 comment

Comments

@Atul-8
Copy link

Atul-8 commented Dec 26, 2024

问题描述

我在 执行 pdf2zh document.pdf命令 或者 pdf2zh -i 命令的时候 都跳出下面警告提示:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "E:\python311\Scripts\pdf2zh.exe\__main__.py", line 4, in <module>
  File "E:\python311\Lib\site-packages\pdf2zh\__init__.py", line 2, in <module>
    from pdf2zh.high_level import translate, translate_stream
  File "E:\python311\Lib\site-packages\pdf2zh\high_level.py", line 15, in <module>
    from pdf2zh.doclayout import DocLayoutModel
  File "E:\python311\Lib\site-packages\pdf2zh\doclayout.py", line 5, in <module>
    import onnx
  File "E:\python311\Lib\site-packages\onnx\__init__.py", line 77, in <module>
    from onnx.onnx_cpp2py_export import ONNX_ML
ImportError: DLL load failed while importing onnx_cpp2py_export: 动态链接库(DLL)初始化例程失败。

尝试解决方法

test1: 我在电脑执行了重新安装 onnx , 并没有解决问题;
pip uninstall onnx
pip install onnx
test2: 我将onnx 的路径加入了环境变量. 并没有解决问题
test3: 重启电脑, 并没有解决问题
test4: 卸载最新版 onnx-1.17.0, 安装 onnx==1.16.1 初始化解决,但有新报错

 raise LocalEntryNotFoundError(
huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

test5: 将代理地址从香港换成日本, 成功使用(全局代理)

电脑环境

python --version
Python 3.11.0
操作系统:
window10

@Wybxc
Copy link
Collaborator

Wybxc commented Dec 26, 2024

#178

@Byaidu Byaidu closed this as completed Dec 26, 2024
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

3 participants