I'm working on a code that uses Whisper, and I need PyTorch with CUDA to improve the speed of the model execution, I have CUDA installed (verified using nvidia-smi command where it shows that I have CUDA 12.6) and I installed PyTorch using the command pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121, but when I try to import torch in Python (import torch) I get the error:
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\Windows10\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
I tried uninstalling PyTorch completely and reinstalling several times but it didn't work, apparently the installation is successful but for some reason Python cannot access it, i have Python 3.11.3. Any help is appreciated
Uninstalled all:
pip uninstall torch torchvision torchaudio
Then installed the one-step older version:
pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0
Now, it's working fine.
Initially, I got this problem after the installation of torchvision, torch was working fine before that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With