Having this same issue:
Windows 11 / RTX 5080 / python 3.13.9 / torch 2.9.1+cu128 / torchvision 0.24.1+cu128
Has no one found a recent solution? I’ve tried following this video from a Reddit post but the info is outdated and it looks like these changes have already been made to init.py for more recent version of torch: https://www.youtube.com/watch?v=ca34C8ZUI0A
Maybe it can help someone.
I was just having the same issue, by running python -c "import torch” inside the terminal I also got the error OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
I had first installed numpy from conda-forge, from what I uderstood that uses MKL and resulted in a conflict with torch crashing, but inside a jupyter notebook the reported error was only Error loading “\lib\site-packages\torch\lib\shm.dll” or one of its dependencies.
My fix was first installing torch via pip in a new clean enviroment, which automatically installs numpy with OpenBLAS, or installing the “nomkl” package before installing numpy from conda-forge forcing to install package versions without MKL.