-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoc_cls.job
executable file
·41 lines (38 loc) · 1.31 KB
/
voc_cls.job
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
#$ -l h_rt=300:00:00
#$ -cwd
source ~/.bash_profile
# Make sure $CFGFILE and $TMPFOLDER exist
echo "Running training"
rm -rfv /local/vdvelden
mkdir /local/vdvelden
mkdir "/local/vdvelden/$TMPFOLDER"
TMPFOLDER="/local/vdvelden/$TMPFOLDER"
python voc_cls.py $CFGFILE $TMPFOLDER
NO_BATCHES=`cat $TMPFOLDER/testinfo.txt | sed -n '1p'`
NO_CLASSES=`cat $TMPFOLDER/testinfo.txt | sed -n '2p'`
CLASSES=(`cat $TMPFOLDER/testinfo.txt | tail -n +3`)
echo "No of batches: $NO_BATCHES"
echo "No of classes: $NO_CLASSES"
echo "Classes: ${CLASSES[@]}"
# Using 4 parallel processes, define the numbr of iterations per batch to cover
# all classes, and how many processes there should be in each iteration
NO_FULL_ITS=`echo $(($NO_CLASSES/4))`
FULL_ITS=`seq 1 $NO_FULL_ITS`
IT_SIZES=`for it in $FULL_ITS; do echo '4'; done; echo $(($NO_CLASSES%4))`
for B in `seq 1 $NO_BATCHES`; do
echo "Running batch $B"
START_CLS=0
for SZ in $IT_SIZES; do
echo "Running iteration of $SZ processes"
STOP_CLS=$(($START_CLS+$SZ-1))
for P in `seq $START_CLS $STOP_CLS`; do
CLS=${CLASSES[$P]}
echo "Running test on class no $P ($CLS)"
python voc_cls_test.py $CFGFILE $TMPFOLDER $B $CLS&
done
wait
START_CLS=$(($START_CLS+$SZ))
done
done
rm -rfv /local/vdvelden