-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
start2.sh
80 lines (66 loc) · 2.1 KB
/
start2.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
set -eu
DOCKER_IMAGE=dannadori/voice-changer:20230129_152955
#DOCKER_IMAGE=voice-changer
if [ $# = 0 ]; then
echo "
usage:
$0 <MODE> <params...>
MODE: select one of ['TRAIN', 'MMVC']
" >&2
exit 1
fi
MODE=$1
### DEFAULT VAR ###
DEFAULT_EX_PORT=18888
DEFAULT_EX_TB_PORT=16006
DEFAULT_USE_GPU=on # on|off
# DEFAULT_VERBOSE=off # on|off
### ENV VAR ###
EX_PORT=${EX_PORT:-${DEFAULT_EX_PORT}}
EX_TB_PORT=${EX_TB_PORT:-${DEFAULT_EX_TB_PORT}}
USE_GPU=${USE_GPU:-${DEFAULT_USE_GPU}}
# VERBOSE=${VERBOSE:-${DEFAULT_VERBOSE}}
#echo $EX_PORT $USE_GPU $VERBOSE
###
if [ "${MODE}" = "TRAIN" ]; then
echo "トレーニングを開始します"
docker run -it --rm --gpus all --shm-size=128M \
-v `pwd`/work_dir/logs:/voice-changer-internal/voice-change-service/MMVC_Trainer/logs \
-v `pwd`/work_dir/dataset:/voice-changer-internal/voice-change-service/MMVC_Trainer/dataset \
-v `pwd`/work_dir/info:/voice-changer-internal/voice-change-service/info \
-e LOCAL_UID=$(id -u $USER) \
-e LOCAL_GID=$(id -g $USER) \
-e EX_PORT=${EX_PORT} -e EX_TB_PORT=${EX_TB_PORT} \
-e EX_IP="`hostname -I`" \
-p ${EX_PORT}:18888 -p ${EX_TB_PORT}:6006 \
$DOCKER_IMAGE "$@"
elif [ "${MODE}" = "MMVC" ]; then
if [ "${USE_GPU}" = "on" ]; then
echo "MMVCを起動します(with gpu)"
docker run -it --rm --gpus all --shm-size=128M \
-v `pwd`/vc_resources:/resources \
-e LOCAL_UID=$(id -u $USER) \
-e LOCAL_GID=$(id -g $USER) \
-e EX_IP="`hostname -I`" \
-e EX_PORT=${EX_PORT} \
-p ${EX_PORT}:18888 \
$DOCKER_IMAGE "$@"
else
echo "MMVCを起動します(only cpu)"
docker run -it --rm --shm-size=128M \
-v `pwd`/vc_resources:/resources \
-e LOCAL_UID=$(id -u $USER) \
-e LOCAL_GID=$(id -g $USER) \
-e EX_IP="`hostname -I`" \
-e EX_PORT=${EX_PORT} \
-p ${EX_PORT}:18888 \
$DOCKER_IMAGE "$@"
fi
else
echo "
usage:
$0 <MODE> <params...>
MODE: select one of ['TRAIN', 'MMVC']
" >&2
fi