Answers for "print cuda device pytorch"

4

install pytorch for cuda 10.0

# CUDA 10.2
pip install torch==1.6.0 torchvision==0.7.0

# CUDA 10.1
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

# CUDA 9.2
pip install torch==1.6.0+cu92 torchvision==0.7.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

# CPU only
pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Posted by: Guest on November-11-2020
1

pytorch get gpu number

torch.cuda.device_count()
Posted by: Guest on May-29-2020
0

pytorch disable cuda

# run this in the terminal
export CUDA_VISIBLE_DEVICES=""
Posted by: Guest on February-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language