-
Notifications
You must be signed in to change notification settings - Fork 54
/
install_original.sh
64 lines (54 loc) · 2.92 KB
/
install_original.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Copyright (C) 2020 University of Pisa
# Copyright (C) 2023 University of Pisa, University of Vienna
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Default Python version
PYTHON_VERSION=python3.8
# default pytorch version is 2.0.1
# available options are 1.4.0 and 2.0.1
PYTORCH_VERSION=1.4.0
# Default Torch Geometric version
TORCH_GEOMETRIC_VERSION=1.4.2
# set CUDA variable (defaults to cpu if no argument is provided to the script)
# available options for pytorch 2.0.1 are cpu, and cu117
# available options for pytorch 1.4.0 are cpu, cu92, cu100, and cu101
CUDA_VERSION=${1:-"cpu"}
echo "Using Python version: ${PYTHON_VERSION}"
echo "Installing PyTorch ${PYTORCH_VERSION} with CUDA ${CUDA_VERSION} support"
echo "Torch Geometric version: ${TORCH_GEOMETRIC_VERSION}"
# create virtual environment and activate it
$PYTHON_VERSION -m pip install --user virtualenv
$PYTHON_VERSION -m venv ~/.venv/gnn-comparison
source ~/.venv/gnn-comparison/bin/activate
pip install build wheel
# install requirements
pip install -r requirements_original.txt
# install pytorch
if [[ "$CUDA_VERSION" == "cpu" ]]; then
pip install torch==${PYTORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/cpu
elif [[ "$CUDA_VERSION" == 'cu92' ]]; then
pip install torch==${PYTORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/cu92
elif [[ "$CUDA_VERSION" == 'cu100' ]]; then
pip install torch==${PYTORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/cu100
elif [[ "$CUDA_VERSION" == 'cu101' ]]; then
pip install torch==${PYTORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/cu101
fi
# install torch-geometric dependencies
pip install torch-scatter==latest+${CUDA_VERSION} -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-${PYTORCH_VERSION}.html
pip install torch-sparse==latest+${CUDA_VERSION} -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-${PYTORCH_VERSION}.html
pip install torch-cluster==latest+${CUDA_VERSION} -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-${PYTORCH_VERSION}.html
pip install torch-spline-conv==latest+${CUDA_VERSION} -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-${PYTORCH_VERSION}.html
pip install torch-geometric==1.4.2 -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-${PYTORCH_VERSION}.html