import datasets
import openvino
from optimum.intel.openvino import OVModelForCausalLM
Traceback (most recent call last):
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\transformers\utils\import_utils.py", line 1603, in _get_module
return importlib.import_module("." + module_name, self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\onnx\graph_transformations.py", line 19, in <module>
import onnx
File "C:\Users\akashapo\IntelProjects\my_env\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: A dynamic link library (DLL) initialization routine failed.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\intel\openvino\__init__.py", line 51, in <module>
from .quantization import OVQuantizer
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\intel\openvino\quantization.py", line 42, in <module>
from optimum.exporters.onnx.convert import check_dummy_inputs_are_allowed
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\exporters\__init__.py", line 16, in <module>
from .tasks import TasksManager # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\exporters\tasks.py", line 173, in <module>
class TasksManager:
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\exporters\tasks.py", line 338, in TasksManager
"clip-text-model": supported_tasks_mapping(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\exporters\tasks.py", line 117, in supported_tasks_mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\optimum\exporters\onnx\model_configs.py", line 23, in <module>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akashapo\IntelProjects\my_env\Lib\site-packages\transformers\utils\import_utils.py", line 1605, in _get_module
raise RuntimeError(
RuntimeError: 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: A dynamic link library (DLL) initialization routine failed.
While this code works fine
import openvino
import datasets
from optimum.intel.openvino import OVModelForCausalLM
This happens on Windows machine with the following packages:
Running the following code leads ot an error
While this code works fine
This happens on Windows machine with the following packages: