-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_train_scene.sh
executable file
·58 lines (48 loc) · 1.23 KB
/
local_train_scene.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
Help()
{
# Display Help
echo "Perform training task locally."
echo
echo "Syntax: $0 [-a <archive name>] [-h]"
echo "options:"
echo "a specify target archive name (including extension, default to 'wip.tgz')."
echo "h Print this Help."
echo
}
archive=""
while getopts ":ha:" option; do
case $option in
h) # display Help
Help
exit;;
a) # Enter a name
archive=$OPTARG;;
\?) # Invalid option
echo "Error: Invalid option"
Help
exit;;
esac
done
if [[ -z "$TRAINER_DIR" ]]; then
echo "Missing env variable TRAINER_DIR !"
exit
fi
if [[ -z "$JOB_DIR" ]]; then
echo "Missing env variable JOB_DIR !"
exit
fi
if [[ -z "$STEERING_BUCKET_NAME" ]]; then
echo "Missing env variable STEERING_BUCKET_NAME !"
exit
fi
if [[ -z "$archive" ]]; then
archive="wip.tgz"
echo "using default archive name $archive"
fi
dest="gs://${STEERING_BUCKET_NAME}/training/"
gcloud ai-platform local train \
--package-path $TRAINER_DIR/task \
--module-name task.train \
--job-dir $JOB_DIR -- --bucket ${STEERING_BUCKET_NAME} --archive $archive --model scene_detector
# --packages ~/projects/rrl_2023/donkeycar/donkeycar.tar.gz \