-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
69 lines (57 loc) · 2.11 KB
/
setup.sh
File metadata and controls
69 lines (57 loc) · 2.11 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
#!/bin/bash
python -m venv ./.venv
source ./.venv/bin/activate
# install only top requirements
pip install tensorflow==2.15.0
pip install matplotlib
pip install scipy
pip install -i https://test.pypi.org/simple/ nasbench-TF2
pip install ml_dtypes==0.4.0
pip install seaborn
pip install nats_bench
pip install torchvision
pip install gdown
# Install ipykernel to make the virtual environment available as a Jupyter kernel
pip install ipykernel
python -m ipykernel install --user --name=.venv --display-name "Python (.venv)"
# make user generated folders
mkdir -p "output"
mkdir -p "generated"
mkdir -p "thirdparty"
# download nasbench script
python ./experiments/utils/download_nasbench.py
# init submodule
# Check if the repository is inside a Git submodule (when not cloned but installed from zip)
if [ ! -d ".git" ]; then
echo "Initializing Git repository..."
git init
fi
git submodule update --init --recursive
if [ ! -d "./thirdparty/autodl/.git" ]; then
echo "Cloning missing AutoDL submodule..."
git clone https://github.com/D-X-Y/AutoDL-Projects.git thirdparty/autodl
fi
cd ./thirdparty/autodl
pip install .
cd ../..
# Ask user if they want to set it permanently
read -p " Do you want me to set TORCH_HOME permanently in your ~/.bashrc? (required for NATS-Bench) (y/n): " answer
if [[ "$answer" =~ ^[Yy]$ ]]; then
# Check if it already exists in the file
if grep -q "TORCH_HOME" ~/.bashrc; then
echo " It looks like TORCH_HOME is already set in ~/.bashrc."
echo "You might want to review it manually."
echo "Please still download NATS-Bench via this command:"
echo "python ./experiments/utils/download_natsbench.py"
else
echo "Running: export TORCH_HOME=\"$(pwd)/generated\" >> ~/.bashrc"
echo "export TORCH_HOME=\"$(pwd)/generated\"" >> ~/.bashrc
source ~/.bashrc
source ./.venv/bin/activate
python ./experiments/utils/download_natsbench.py
fi
else
echo "Please add TORCH_HOME permanently to your path"
echo "Additionally, download NATS-Bench via this command:"
echo "python ./experiments/utils/download_natsbench.py"
fi