This commit is contained in:
wataru 2022-11-12 10:44:01 +09:00
parent be014c03a8
commit ff1a86f3da
3 changed files with 7 additions and 32 deletions

View File

@ -1,8 +1,5 @@
#!/bin/bash #!/bin/bash
# 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/
#set -eux
set -eu set -eu
MODE=$1 MODE=$1
@ -31,32 +28,13 @@ if [ "${MODE}" = "MMVC" ] ; then
find /resources/ -type f -name "config.json" | xargs -I{} sh -c 'echo "config.jsonをコピーします。" && cp {} ./' find /resources/ -type f -name "config.json" | xargs -I{} sh -c 'echo "config.jsonをコピーします。" && cp {} ./'
find /resources/ -type f -name "*.pth" | xargs -I{} sh -c 'echo "`basename {}`をコピーします。" && cp {} ./' find /resources/ -type f -name "*.pth" | xargs -I{} sh -c 'echo "`basename {}`をコピーします。" && cp {} ./'
# if [ "${VERBOSE}" = "on" ]; then
# echo "MMVCを起動します(verbose)"
# python3 MMVCServerSIO.py $PARAMS
# else
# echo "MMVCを起動します"
# python3 MMVCServerSIO.py $PARAMS 2>stderr.txt
# fi
echo "MMVCを起動します" echo "MMVCを起動します"
python3 MMVCServerSIO.py $PARAMS #2>stderr.txt python3 MMVCServerSIO.py -t MMVC $PARAMS #2>stderr.txt
elif [ "${MODE}" = "MMVC_TRAIN" ] ; then elif [ "${MODE}" = "TRAIN" ] ; then
cd /voice-changer-internal/voice-change-service cd /voice-changer-internal/voice-change-service
# python3 create_dataset_jtalk.py -f train_config -s 24000 -m dataset/multi_speaker_correspondence.txt
# # date_tag=`date +%Y%m%d%H%M%S`
# sed -ie 's/80000/8000/' train_ms.py
# sed -ie "s/\"batch_size\": 10/\"batch_size\": $batch_size/" configs/train_config.json
# sed -ie "s/torch.cuda.device_count()/1/" train_ms.py
python3 -m tensorboard.main --logdir /MMVC_Trainer/logs --port 6006 --host 0.0.0.0 & python3 -m tensorboard.main --logdir /MMVC_Trainer/logs --port 6006 --host 0.0.0.0 &
python3 MMVCServerSIO.py $PARAMS python3 MMVCServerSIO.py -t TRAIN $PARAMS
# if ${resume_flag}; then
# echo "トレーニング再開。バッチサイズ: ${batch_size}。"
# python3 train_ms.py -c configs/train_config.json -m vc
# else
# echo "トレーニング開始。バッチサイズ: ${batch_size}。"
# python3 train_ms.py -c configs/train_config.json -m vc -fg fine_model/G_180000.pth -fd fine_model/D_180000.pth
# fi
fi fi

View File

@ -3,12 +3,10 @@
# 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/ # 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/
set -eu set -eu
echo "1"
# 実行ユーザ作成 # 実行ユーザ作成
USER_ID=${LOCAL_UID:-9001} USER_ID=${LOCAL_UID:-9001}
GROUP_ID=${LOCAL_GID:-9001} GROUP_ID=${LOCAL_GID:-9001}
echo "2"
echo "exec with [UID : $USER_ID, GID: $GROUP_ID]" echo "exec with [UID : $USER_ID, GID: $GROUP_ID]"
useradd -u $USER_ID -o -m user useradd -u $USER_ID -o -m user
groupmod -g $GROUP_ID user groupmod -g $GROUP_ID user

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
DOCKER_IMAGE=dannadori/voice-changer:20221112_102442 DOCKER_IMAGE=dannadori/voice-changer:20221112_104247
# DOCKER_IMAGE=voice-changer # DOCKER_IMAGE=voice-changer
if [ $# = 0 ]; then if [ $# = 0 ]; then
@ -14,7 +14,6 @@ if [ $# = 0 ]; then
fi fi
MODE=$1 MODE=$1
PARAMS=${@:2:($#-1)}
### DEFAULT VAR ### ### DEFAULT VAR ###
DEFAULT_EX_PORT=18888 DEFAULT_EX_PORT=18888
@ -44,7 +43,7 @@ if [ "${MODE}" = "TRAIN" ]; then
-e EX_PORT=${EX_PORT} -e EX_TB_PORT=${EX_TB_PORT} \ -e EX_PORT=${EX_PORT} -e EX_TB_PORT=${EX_TB_PORT} \
-e EX_IP="`hostname -I`" \ -e EX_IP="`hostname -I`" \
-p ${EX_PORT}:8080 -p ${EX_TB_PORT}:6006 \ -p ${EX_PORT}:8080 -p ${EX_TB_PORT}:6006 \
$DOCKER_IMAGE -t TRAIN "$@" $DOCKER_IMAGE TRAIN "$@"
elif [ "${MODE}" = "MMVC" ]; then elif [ "${MODE}" = "MMVC" ]; then
@ -58,7 +57,7 @@ elif [ "${MODE}" = "MMVC" ]; then
-e EX_IP="`hostname -I`" \ -e EX_IP="`hostname -I`" \
-e EX_PORT=${EX_PORT} \ -e EX_PORT=${EX_PORT} \
-p ${EX_PORT}:8080 \ -p ${EX_PORT}:8080 \
$DOCKER_IMAGE -t MMVC "$@" $DOCKER_IMAGE MMVC "$@"
else else
echo "MMVCを起動します(only cpu)" echo "MMVCを起動します(only cpu)"
docker run -it --shm-size=128M \ docker run -it --shm-size=128M \
@ -68,7 +67,7 @@ elif [ "${MODE}" = "MMVC" ]; then
-e EX_IP="`hostname -I`" \ -e EX_IP="`hostname -I`" \
-e EX_PORT=${EX_PORT} \ -e EX_PORT=${EX_PORT} \
-p ${EX_PORT}:8080 \ -p ${EX_PORT}:8080 \
$DOCKER_IMAGE -t MMVC "$@" $DOCKER_IMAGE MMVC "$@"
fi fi
else else
echo " echo "