install.sh 798 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash

unset PYTORCH_VERSION
# For unittest, nightly PyTorch is used as the following section,
# so no need to set PYTORCH_VERSION.
# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config.

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env

moto's avatar
moto committed
13
14
15
16
17
18
19
20
if [ -z "${CUDA_VERSION:-}" ] ; then
    cudatoolkit="cpuonly"
else
    version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
    cudatoolkit="cudatoolkit=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c pytorch-nightly pytorch "${cudatoolkit}"
21
22
23
24
25

printf "* Installing torchaudio\n"
# Link codecs present at /third_party. See Dockerfile for how this is built
ln -fs /third_party ./third_party
IS_CONDA=true python setup.py develop