yolov8导出onnx报错ONNX: export failure ❌ 0.8s: DLL load failed while importing onnx_cpp2py_export: 动态链
yolov8导出onnx报错ONNX: export failure ❌ 0.8s: DLL load failed while importing onnx_cpp2py_export: 动态链
Traceback (most recent call last):
File “C:\Users\bx\Desktop\0904代码\0904代码\ultralytics\111_v8_detect_my_export官方.py”, line 9, in
model.export(format=“onnx”, imgsz=1024)
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\ultralytics\engine\model.py”, line 348, in export
return Exporter(overrides=args, callbacks=self.callbacks)(model=self.model)
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\torch\utils_contextlib.py”, line 115, in decorate_context
return func(*args, **kwargs)
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\ultralytics\engine\exporter.py”, line 277, in call
f[2], _ = self.export_onnx()
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\ultralytics\engine\exporter.py”, line 136, in outer_func
raise e
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\ultralytics\engine\exporter.py”, line 131, in outer_func
f, model = inner_func(*args, **kwargs)
File “C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\ultralytics\engine\exporter.py”, line 347, in export_onnx
import onnx # noqa
File "C:\Users\bx\AppData\Local\anaconda3\envs\mw\lib\site-packages\onnx_init.py", line 77, in
ONNX: export failure ❌ 0.8s: DLL load failed while importing onnx_cpp2py_export: 动态链接库(DLL)初始化例程失败。
from onnx.onnx_cpp2py_export import ONNX_ML
ImportError: DLL load failed while importing onnx_cpp2py_export: 动态链接库(DLL)初始化例程失败。
解决:
重新conda create 创建新的环境,然后pip 安装onnx和ultralytics,在新的虚拟环境中导出onnx
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)