The PyTorch installation web page shows how to install the GPU and CPU versions of PyTorch:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
and
conda install pytorch torchvision cpuonly -c pytorch
Can both version be installed in the same Conda
environment?
In case you might ask why would this be needed, it's because I would like a single Conda
environment which I can use on computers which have a GPU and those which don't.
The GPU version of PyTorch is actually a superset of the CPU PyTorch. You can use the GPU PyTorch on a CPU, but you cannot use the CPU PyTorch on a GPU. So in your case, installing just the GPU version of PyTorch would be sufficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With