-
Notifications
You must be signed in to change notification settings - Fork 75
/
train.sh
executable file
·35 lines (31 loc) · 1.26 KB
/
train.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
function rand(){
min=$1
max=$(($2-$min+1))
num=$(date +%s%N)
echo $(($num%$max+$min))
}
port=$(rand 10000 30000)
lod=0
iterations=30_000
warmup="False"
while [[ "$#" -gt 0 ]]; do
case $1 in
-l|--logdir) logdir="$2"; shift ;;
-d|--data) data="$2"; shift ;;
--lod) lod="$2"; shift ;;
--gpu) gpu="$2"; shift ;;
--warmup) warmup="$2"; shift ;;
--voxel_size) vsize="$2"; shift ;;
--update_init_factor) update_init_factor="$2"; shift ;;
--appearance_dim) appearance_dim="$2"; shift ;;
--ratio) ratio="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
time=$(date "+%Y-%m-%d_%H:%M:%S")
if [ "$warmup" = "True" ]; then
python train.py --eval -s data/${data} --lod ${lod} --gpu ${gpu} --voxel_size ${vsize} --update_init_factor ${update_init_factor} --appearance_dim ${appearance_dim} --ratio ${ratio} --warmup --iterations ${iterations} --port $port -m outputs/${data}/${logdir}/$time
else
python train.py --eval -s data/${data} --lod ${lod} --gpu ${gpu} --voxel_size ${vsize} --update_init_factor ${update_init_factor} --appearance_dim ${appearance_dim} --ratio ${ratio} --iterations ${iterations} --port $port -m outputs/${data}/${logdir}/$time
fi