最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - conda cuda enabled pytorch installation problem - Stack Overflow

programmeradmin6浏览0评论

im getting this problem where i have installed pytorch following these steps (/@harunijaz/a-step-by-step-guide-to-installing-cuda-with-pytorch-in-conda-on-windows-verifying-via-console-9ba4cd5ccbef) exactly, but i can't get the cuda env to recognise the torch install

>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torch'
>>>

im getting this problem where i have installed pytorch following these steps (https://medium/@harunijaz/a-step-by-step-guide-to-installing-cuda-with-pytorch-in-conda-on-windows-verifying-via-console-9ba4cd5ccbef) exactly, but i can't get the cuda env to recognise the torch install

>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torch'
>>>

Share Improve this question edited Mar 27 at 3:27 Derek O 19.7k4 gold badges29 silver badges49 bronze badges asked Mar 27 at 2:55 sakshisakshi 235 bronze badges 1
  • 2 Looks like the conda install pytorch torchvision torchaudio pytorch-cuda -c pytorch -c nvidia is executed outside the conda environment instead of executing conda install inside the environment (which in your case seems barracuda) – Shuhul Handoo Commented Mar 27 at 2:59
Add a comment  | 

1 Answer 1

Reset to default 1

Run conda list torch to see if it's installed. Make sure you run this inside your Conda environment.

If you don't see it run:

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

Change the version depending on your requirements and what your GPU supports. You can find more info here.

发布评论

评论列表(0)

  1. 暂无评论