-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pyenvs.sh
80 lines (63 loc) · 2.24 KB
/
build-pyenvs.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
menu () {
# clear
printf "\n"
printf "____________ Build Envs & Install Requirements ____________\n\n"
printf "1. General\n"
printf "2. TensorFlow CPU\n"
printf "3. TensorFlow GPU\n"
printf "4. PyTorch CPU\n"
printf "5. PyTorch GPU\n\n"
printf "____________ Install Requirements Only ____________\n\n"
printf "6. General\n"
printf "7. TensorFlow CPU\n"
printf "8. TensorFlow GPU\n"
printf "9. PyTorch CPU\n"
printf "10. PyTorch GPU\n"
printf "q. Exit\n\n"
printf "Select: "
}
main () {
# clear
while :
do
#clear
menu
read menu_selection
if [[ $menu_selection == "1" ]]; then
conda env create -f scripts/pyenvs/general.yaml
elif [[ $menu_selection == "2" ]]; then
conda env create -f scripts/pyenvs/tf-cpu.yaml
elif [[ $menu_selection == "3" ]]; then
conda env create -f scripts/tf-gpu.yaml
elif [[ $menu_selection == "4" ]]; then
conda env create -f scripts/torch-cpu.yaml
elif [[ $menu_selection == "5" ]]; then
conda env create -f scripts/torch-gpu.yaml
elif [[ $menu_selection == "6" ]]; then
conda activate general
pip install -r scripts/pyenvs/requirements-general.txt
elif [[ $menu_selection == "7" ]]; then
conda activate tf
pip install -r scripts/pyenvs/requirements-tf-cpu.txt
elif [[ $menu_selection == "8" ]]; then
conda activate tf-gpu
pip install -r scripts/pyenvs/requirements-tf-gpu.txt
elif [[ $menu_selection == "9" ]]; then
conda activate torch
pip install -r scripts/pyenvs/requirements-torch-cpu.txt
elif [[ $menu_selection == "10" ]]; then
conda activate torch-gpu
pip install -r scripts/pyenvs/requirements-torch-gpu.txt
elif [[ $menu_selection == "q" ]]; then
exit
else
printf "Wrong Choice!\n"
fi
done
}
# The eval command make sub-shell recognize conda commands. For more Visit:
# https://stackoverflow.com/a/70474019
# https://stackoverflow.com/a/55507956
eval "$(conda shell.bash hook)"
main