pytorch-install.sh 711 B

123456789101112131415
  1. #!/bin/bash
  2. python_executable=python$1
  3. pytorch_version=$2
  4. cuda_version=$3
  5. # Install torch
  6. $python_executable -m pip install numpy pyyaml scipy ipython mkl mkl-include ninja cython typing pandas typing-extensions dataclasses setuptools && conda clean -ya
  7. $python_executable -m pip install torch==${pytorch_version}+cu${cuda_version//./} --extra-index-url https://download.pytorch.org/whl/cu${cuda_version//./}
  8. # Print version information
  9. $python_executable --version
  10. $python_executable -c "import torch; print('PyTorch:', torch.__version__)"
  11. $python_executable -c "import torch; print('CUDA:', torch.version.cuda)"
  12. $python_executable -c "from torch.utils import cpp_extension; print (cpp_extension.CUDA_HOME)"