-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·156 lines (138 loc) · 4.27 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·156 lines (138 loc) · 4.27 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
# Local variables
PROJECT_NAME=spt
PYTHON=3.8
TORCH=2.2.0
CUDA_SUPPORTED=(11.8 12.1)
# Check if torchsparse should be installed
INSTALL_TORCHSPARSE=false
if [[ "$1" == "with_torchsparse" ]]; then
INSTALL_TORCHSPARSE=true
elif [[ -n "$1" ]]; then
echo "Unknown argument: $1"
echo "Usage: ./install.sh [with_torchsparse]"
echo " with_torchsparse: Install TorchSparse (optional dependency)"
exit 1
fi
# Recover the project's directory from the position of the install.sh
# script and move there. Not doing so would install some dependencies in
# the wrong place
HERE=`dirname $0`
HERE=`realpath $HERE`
cd $HERE
# Installation of Superpoint Transformer in a conda environment
echo "_____________________________________________"
echo
echo " 🧩 Superpoint Transformer 🤖 "
echo " Installer "
echo
echo "_____________________________________________"
echo
echo
echo "⭐ Searching for installed CUDA"
echo
# Recover the CUDA version using nvcc
CUDA_VERSION=`nvcc --version | grep release | sed 's/.* release //' | sed 's/, .*//'`
CUDA_MAJOR=`echo ${CUDA_VERSION} | sed 's/\..*//'`
CUDA_MINOR=`echo ${CUDA_VERSION} | sed 's/.*\.//'`
# If CUDA version not supported, print error and exit
if [[ ! " ${CUDA_SUPPORTED[*]} " =~ " ${CUDA_VERSION} " ]]
then
echo "Found CUDA ${CUDA_VERSION} installed, which is not among the supported versions: "`echo ${CUDA_SUPPORTED[*]}`
echo "Please update CUDA to one of the supported versions."
exit 1
fi
echo
echo
echo "⭐ Searching for installed conda"
echo
# Recover the path to conda on your machine
# First search the default '~/miniconda3' and '~/anaconda3' paths. If
# those do not exist, ask for user input
CONDA_DIR=`realpath ~/miniconda3`
if (test -z $CONDA_DIR) || [ ! -d $CONDA_DIR ]
then
CONDA_DIR=`realpath ~/anaconda3`
fi
while (test -z $CONDA_DIR) || [ ! -d $CONDA_DIR ]
do
echo "Could not find conda at: "$CONDA_DIR
read -p "Please provide your conda install directory: " CONDA_DIR
CONDA_DIR=`realpath $CONDA_DIR`
done
echo "Using conda conda found at: ${CONDA_DIR}/etc/profile.d/conda.sh"
source ${CONDA_DIR}/etc/profile.d/conda.sh
echo
echo
echo "⭐ Creating conda environment '${PROJECT_NAME}'"
echo
# Create deep_view_aggregation environment from yml
conda create --name ${PROJECT_NAME} python=${PYTHON} -y
# Activate the env
source ${CONDA_DIR}/etc/profile.d/conda.sh
conda activate ${PROJECT_NAME}
echo
echo
echo "⭐ Installing conda and pip dependencies"
echo
conda install pip nb_conda_kernels -y
pip install matplotlib
pip install plotly==5.9.0
pip install "jupyterlab>=3" "ipywidgets>=7.6" jupyter-dash
pip install "notebook>=5.3" "ipywidgets>=7.5"
pip install ipykernel
pip3 install torch==${TORCH} torchvision --index-url https://download.pytorch.org/whl/cu${CUDA_MAJOR}${CUDA_MINOR}
pip install torchmetrics==0.11.4
pip install pyg_lib torch_scatter torch_cluster -f https://data.pyg.org/whl/torch-${TORCH}+cu${CUDA_MAJOR}${CUDA_MINOR}.html
pip install torch_geometric==2.3.0
pip install plyfile
pip install h5py
pip install colorhash
pip install seaborn
pip install numba
pip install pytorch-lightning
pip install pyrootutils
pip install hydra-core --upgrade
pip install hydra-colorlog
pip install hydra-submitit-launcher
pip install "rich<=14.0"
pip install torch_tb_profiler
pip install wandb
pip install open3d
pip install gdown
pip install ipyfilechooser
pip install torch-ransac3d
pip install pgeof
pip install pycut-pursuit
pip install pygrid-graph
pip install torch-graph-components
echo
echo
echo "⭐ Installing FRNN"
echo
git clone --recursive https://github.com/lxxue/FRNN.git src/dependencies/FRNN
# install a prefix_sum routine first
cd src/dependencies/FRNN/external/prefix_sum
pip install .
# install FRNN
cd ../../ # back to the {FRNN} directory
pip install .
cd ../../../
# install TorchSparse (optional)
if [[ "$INSTALL_TORCHSPARSE" == true ]]; then
echo
echo
echo "⭐ Installing TorchSparse"
echo
git clone https://github.com/mit-han-lab/torchsparse.git src/dependencies/torchsparse
pip install backports.cached-property
pip install rootpath
conda install -y google-sparsehash -c bioconda
cd src/dependencies/torchsparse
pip install .
cd ../../../
fi
# let user know
echo
echo
echo "🚀 Successfully installed SPT"