-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdocker-entrypoint.sh
executable file
·55 lines (49 loc) · 1.24 KB
/
docker-entrypoint.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
#!/usr/bin/env bash
ln /dev/null /dev/raw1394
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CUR_DIR/util/functions"
TASK="$1"
ARG1="$2"
CONFIG_FILE="/config/config.yml"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: config.yml does not exist."
exit 1
fi
if [[ "$TASK" = 'finetune' ]]; then
util/finetune.sh
elif [[ "$TASK" = 'gen_train' ]]; then
if [[ "$ARG1" = '' ]]; then
IMAGE_SIZE=224
else
IMAGE_SIZE="$ARG1"
fi
util/gen_train.sh "$CONFIG_FILE" "$IMAGE_SIZE"
elif [[ "$TASK" = 'gen_test' ]]; then
if [[ "$ARG1" = '' ]]; then
IMAGE_SIZE=224
else
IMAGE_SIZE="$ARG1"
fi
util/gen_test.sh "$CONFIG_FILE" "$IMAGE_SIZE"
elif [[ "$TASK" = 'test' ]]; then
util/test.sh
elif [[ "$TASK" = 'export' ]]; then
util/export_model.sh
elif [[ "$TASK" = 'ensemble' ]]; then
util/ensemble.sh "$ARG1"
elif [[ "$TASK" = 'num_layers' ]]; then
util/num_layers.sh "$ARG1"
elif [[ "$TASK" = 'jupyter' ]]; then
jupyter notebook --no-browser --port=8888 --ip=0.0.0.0 --allow-root
elif [[ "$TASK" = 'version' ]]; then
version
elif [[ "$TASK" = 'help' ]]; then
usage
else
if [[ "$TASK" = '' ]]; then
util/finetune.sh
else
echo "mxnet-finetuner: '$TASK' is not a mxnet-finetuner command."
usage
fi
fi