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

[WinError 126] The specified module could not be found. Error loading "\venv\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies. #81

Open
MNeMoNiCuZ opened this issue Jul 30, 2024 · 6 comments

Comments

@MNeMoNiCuZ
Copy link

(venv) C:\AI\Tools\Paints-UNDO>python gradio_app.py
Traceback (most recent call last):
File "C:\AI\Tools\Paints-UNDO\gradio_app.py", line 13, in
import torch
File "C:\AI\Tools\Paints-UNDO\venv\lib\site-packages\torch_init_.py", line 148, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\AI\Tools\Paints-UNDO\venv\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

Any suggestions for what to reinstall/setup properly to get rid of this problem?

I've tried reinstalling Visual C++ redist according to this thread:
https://discuss.pytorch.org/t/failed-to-import-pytorch-fbgemm-dll-or-one-of-its-dependencies-is-missing/201969

@Anis-Oukid
Copy link

Anis-Oukid commented Jul 30, 2024

pip install torch==2.2.0 --user
and then kill and reopen the terminal

@MNeMoNiCuZ
Copy link
Author

Which version of CUDA is needed for this?

I have gotten rid of the fbgemm.dll error (seems to have been a W11 VSC++ driver error).

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchvision 0.19.0 requires torch==2.4.0, but you have torch 2.2.0 which is incompatible.
xformers 0.0.27.post2 requires torch==2.4.0, but you have torch 2.2.0 which is incompatible.
Virtual environment activated.
(paints_undo) C:\AI\Tools\Paints-UNDO>py gradio_app.py
Traceback (most recent call last):
  File "C:\AI\Tools\Paints-UNDO\gradio_app.py", line 15, in <module>
    import memory_management
  File "C:\AI\Tools\Paints-UNDO\memory_management.py", line 9, in <module>
    torch.zeros((1, 1)).to(gpu, torch.float32)
  File "C:\AI\Tools\Paints-UNDO\paints_undo\lib\site-packages\torch\cuda\__init__.py", line 293, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

@omkarmohanjoshi
Copy link

How to solve fbgemm.dll error?

@MNeMoNiCuZ
Copy link
Author

How to solve fbgemm.dll error?

image
Get Visual Studio Installer, and then modify the installation. I think it was under Desktop development with C++, and get the latest MSVC. v143 is the one I have now.

@anishmanissery
Copy link

I encountered the same fbgemm.dll error, but I was able to fix it by following the instructions in this YouTube video. After completing the steps mentioned, the issue was resolved for me. Hope this helps others facing the same problem!

@Rupanshu-Kapoor
Copy link

I encountered the same fbgemm.dll error, but I was able to fix it by following the instructions in this YouTube video. After completing the steps mentioned, the issue was resolved for me. Hope this helps others facing the same problem!

Thanks buddy for the perfect link. <3

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

5 participants