我的文件中确实存在这个文件shm.dll 但是在import torch的时候一直报这个错误,重新卸载安装每个办法都没用,最后查到并且对于我目前成功的方法就是:
pip3 install torch==2.2.2 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
也就是torch安装2.2.2的版本。
方法来源:Error loading "\lib\site-packages\torch\lib\shm.dll" or one of its dependencie - PyTorch Forums