2
votes

I've installed pytorch cuda with pip and conda

when i run this command in IDLE:

>> import torch

>> torch.cuda.is_available()

I get "True", but in Spyder or Jupyter Notebook it gives as "False" even after updating the package and conda. The conda update of pytorch cuda was from 10.1 to 10.2

1

1 Answers

2
votes

It can be resolved by creating another environment in conda and then install torch

type:

>conda create -n yourenvname python=x.x anaconda

yourenvname is environment name

python=x.x is python version for your environment

activate the environment using:

>conda activate yourenvname

then install the PyTorch with cuda:

>conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

open "spyder" or "jupyter notebook" verify if it is installed, type:

> import torch
> torch.cuda.is_available()