-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dep.sh
47 lines (39 loc) · 1.05 KB
/
install_dep.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
#!/bin/bash
apt update
apt upgrade -y
apt install python3.7 python3-pip python3-dev -y
apt install libxml2-dev libxslt-dev -y
apt install pkg-config libhdf5-100 libhdf5-dev -y
apt install llvm-10 llvm-10-dev build-essential -y
apt install libblas-dev liblapack-dev -y
# alias for python3
echo "alias python=python3" >> ~/.bashrc
echo "alias pip=pip3" >> ~/.bashrc
source ~/.bashrc
pip install setuptools ninja
# exit git repo directory
cd ..
python -c "import torch"
if [ $? -eq 1 ]
then
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch/
pip3 install cython
pip3 install -r requirements.txt
# build libtorch and pytorch
# mkdir build_libtorch && cd build_libtorch
# export TORCH_CUDA_ARCH_LIST="7.0"
# python3 ../tools/build_libtorch.py
cd /home/user/src/pytorch
python3 setup.py install
cd ..
fi
python -c "import torchvision"
if [ $? -eq 1 ]
then
# build torchvision for MNIST data
git clone --recursive https://github.com/pytorch/vision
cd vision/
python3 setup.py install
cd ..
fi