-
Notifications
You must be signed in to change notification settings - Fork 0
/
udacity.sh
executable file
·54 lines (45 loc) · 1.04 KB
/
udacity.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
#!/bin/bash
set -e
PYTORCH="pytorch"
# . ~/venv/bin/activate
# deactivate
# . ./pytorch/bin/activate
# which jupyter-lab
# echo "$PATH"
clean_dir () {
# if pytorch exists then delete it
if [[ -d "$PYTORCH" ]]; then
rm -fr "./$PYTORCH"
echo "*** Deleted pytorch folder ***"
fi
}
build () {
clean_dir
python3 -m venv "./$PYTORCH"
. "./$PYTORCH/bin/activate"
pip install -U pip setuptools wheel colorama
pip install -U jupyterlab matplotlib numpy pandas tqdm ipywidgets
pip install -U torch torchvision torchinfo
pip install -U scikit-learn bokeh
# pip install opencv-contrib-python
}
if [[ $# -ne 0 ]] ; then
if [[ $1 = "build" ]]; then
echo ">> Building environment"
build
exit 0
fi
if [[ $1 = "test" ]]; then
echo ">> Test"
exit 0
fi
fi
if [[ ! -d "$PYTORCH" ]]; then
echo "*** Missing pytorch folder ... will build ***"
build
else
echo ">> Good to go!"
. "./$PYTORCH/bin/activate"
fi
# . ./pytorch/bin/activate
jupyter-lab