Featured image of post 在 conda 中安裝 Pytorch

在 conda 中安裝 Pytorch

📝 Steps

conda config --append channels conda-forge
conda config --append channels nvidia

conda install cudatoolkit
pip uninstall torch
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

🗒️ Notes

conda create –name=pytorch python=3.9
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
 
# Verify install
python3 -c "import torch; print(torch.cuda.is_available())"

📖 Ref.

https://www.educative.io/answers/how-to-resolve-torch-not-compiled-with-cuda-enabled

https://stackoverflow.com/a/75756625

Licensed under CC BY-NC-SA 4.0
Last updated on Nov 14, 2023 19:15 CST