-
Notifications
You must be signed in to change notification settings - Fork 14
/
run_exp.sh
41 lines (35 loc) · 911 Bytes
/
run_exp.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
#!/bin/bash
set -e
function main() {
# export CUDA_VISIBLE_DEVICES="2"
export PYTHONPATH=/home/lgcn/argoverse-api:$PYTHONPATH
echo "Using PYTHONPATH:$PYTHONPATH"
if [[ $# -eq 0 ]]; then
echo "please give model_name and exp_name"
echo "==================="
echo "Available model set:"
echo commands/*
exit 1
fi
local model=$1
shift
local exp=$1
if [[ -f "commands/${model}.sh" ]] ; then
source commands/${model}.sh
if [ -n "$(LC_ALL=C type -t ${exp})" ] && [ "$(LC_ALL=C type -t ${exp})" = function ]; then
eval ${exp}
else
echo "exp name ${exp} is NOT set";
echo "=================="
echo "Available experiments:"
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}'
fi
else
echo "No scripts for ${model}"
echo "==================="
echo "Available model set:"
echo commands/*
exit 1
fi
}
main $@