-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_job_linux.txt
executable file
·75 lines (62 loc) · 1.72 KB
/
start_job_linux.txt
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
if [ -z "$1" ] ; then
echo "First argument must be the name"
exit 1
fi
if [ -z "$2" ] ; then
echo "The second argument must be the project index"
exit 2
fi
if [ $2 == "3" ] ; then
PROJECT_ID="nomadic-raceway-224107"
BUCKET_NAME="image2latex3"
elif [ $2 == "4" ] ; then
PROJECT_ID="pivotal-store-224110"
BUCKET_NAME="image2latex3"
elif [ $2 == "2" ] ; then
PROJECT_ID="true-eye-223916"
BUCKET_NAME="image2latex3"
elif [ $2 == "1" ] ; then
PROJECT_ID="image2latex"
BUCKET_NAME="image2latex-mlengine"
else
echo "Unknown project index"
exit 1
fi
NAME=$1
echo "Name is: "$NAME
echo "Project id is: "$PROJECT_ID
echo "Bucket name is: "$BUCKET_NAME
DATE=`date '+%Y_%m_%d__%H_%M'`
JOB_NAME="im2lx_"$DATE$NAME
CONTAINER="gs://"$BUCKET_NAME
OUTPUT_PATH=$CONTAINER"/output"
TB_PATH=$CONTAINER"/logdir"
PROF_PATH=$CONTAINER"/profiling"
REGION="us-central1"
#REGION="europe-west4"
#REGION="us-east1"
#REGION="us-west1"
DATA_URL="new_data/"
OUTPUT_URL="output"
echo "Job: "$JOB_NAME" running on: "$OUTPUT_PATH
gcloud config set project $PROJECT_ID
gcloud ml-engine jobs submit training $JOB_NAME \
--job-dir $OUTPUT_PATH \
--runtime-version 1.12\
--module-name trainer.tf_train_inkml \
--package-path trainer/ \
--region $REGION \
--config config.yaml \
-- \
--gcs $BUCKET_NAME \
--data-base-dir $DATA_URL \
--model-dir $OUTPUT_URL \
--start-epoch -1 \
--git-hexsha `git rev-parse HEAD` \
--gpu 0 \
--tb $TB_PATH \
--tbn $JOB_NAME \
--st t \
--data_format channels_last
echo "To look on the results in tensorboard, go to http://localhost:800"$2
echo "If tensorboard is not started, call \`tensorboard --logdir "$TB_PATH" --port 800"$2"\`"