Issue with shm.dll file

How can i fix this error?

Traceback (most recent call last):
File “d:\koust\Documents\aiiiii\app.py”, line 2, in
from transformers import pipeline
File “C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers_init_.py”, line 26, in
from . import dependency_versions_check
File “C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\dependency_versions_check.py”, line 16, in
from .utils.versions import require_version, require_version_core
File “C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\utils_init_.py”, line 33, in
from .generic import (
File “C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\utils\generic.py”, line 465, in
import torch.utils._pytree as torch_pytree
File "C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch_init
.py", line 141, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users\koust\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\lib\shm.dll” or one of its dependencies.

4 Likes

Did you solved it??

Same Issue here. In python 3.12.

1 Like

facing the same issue here, did you solve it?

A fix was published by the pytorch team 2 days ago:

I tried to replace the file but it didn’t work, I had to change the code directly in the file, like in the commit.