This commit is contained in:
wataru 2022-08-23 09:45:05 +09:00
parent 552303e075
commit 766de696db
4 changed files with 45 additions and 40 deletions

View File

@ -10,6 +10,4 @@ docker run -it --gpus all --shm-size=2g \
-v `pwd`/vc_resources:/resources \ -v `pwd`/vc_resources:/resources \
-e LOCAL_UID=$(id -u $USER) \ -e LOCAL_UID=$(id -u $USER) \
-e LOCAL_GID=$(id -g $USER) \ -e LOCAL_GID=$(id -g $USER) \
-p 6008:6006 -p 8081:8080 mmvc_trainer_docker "$@" -p 6006:6006 -p 8080:8080 dannadori/voice-changer:20220823_085004 "$@"

View File

@ -48,6 +48,7 @@ COPY fine_model/D_180000.pth /MMVC_Trainer/fine_model/D_180000.pth
### Copy from base ### Copy from base
COPY --from=base --chmod=777 /usr/local/lib/python3.9/dist-packages /usr/local/lib/python3.9/dist-packages COPY --from=base --chmod=777 /usr/local/lib/python3.9/dist-packages /usr/local/lib/python3.9/dist-packages
COPY --from=base --chmod=777 /MMVC_Trainer /MMVC_Trainer COPY --from=base --chmod=777 /MMVC_Trainer /MMVC_Trainer
RUN chmod 0777 /MMVC_Trainer
WORKDIR /MMVC_Trainer WORKDIR /MMVC_Trainer
ADD /setup.sh /MMVC_Trainer/ ADD /setup.sh /MMVC_Trainer/

View File

@ -40,8 +40,10 @@ voice_change_flag=false
config= config=
model= model=
escape_flag=false
# オプション解析 # オプション解析
while getopts tb:rvm:c:h OPT; do while getopts tb:rvc:m:hx OPT; do
case $OPT in case $OPT in
t) t)
training_flag=true training_flag=true
@ -64,13 +66,15 @@ while getopts tb:rvm:c:h OPT; do
h | \?) h | \?)
usage && exit 1 usage && exit 1
;; ;;
x)
escape_flag=true
esac esac
done done
## コマンドライン引数から、オプション引数分を削除
# shift $((OPTIND - 1)) # ## コマンドライン引数から、オプション引数分を削除
# # shift $((OPTIND - 1))
# モード解析 # モード解析
if $training_flag && $voice_change_flag; then if $training_flag && $voice_change_flag; then
@ -80,6 +84,8 @@ elif $training_flag; then
echo "■■■ ト レ ー ニ ン グ モ ー ド ■■■" echo "■■■ ト レ ー ニ ン グ モ ー ド ■■■"
elif $voice_change_flag; then elif $voice_change_flag; then
echo "■■■ ボ イ チ ェ ン モ ー ド ■■■" echo "■■■ ボ イ チ ェ ン モ ー ド ■■■"
elif $escape_flag; then
/bin/bash
else else
warn "-tトレーニングモード と -vボイチェンモードのいずれかを指定してください。" warn "-tトレーニングモード と -vボイチェンモードのいずれかを指定してください。"
exit 1 exit 1
@ -87,41 +93,41 @@ fi
if $training_flag; then # if $training_flag; then
python3 create_dataset_jtalk.py -f train_config -s 24000 -m dataset/multi_speaker_correspondence.txt # 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` # # date_tag=`date +%Y%m%d%H%M%S`
sed -ie 's/80000/8000/' train_ms.py # 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/\"batch_size\": 10/\"batch_size\": $batch_size/" configs/train_config.json
python3 -m tensorboard.main --logdir logs --port 6006 --host 0.0.0.0 & # python3 -m tensorboard.main --logdir logs --port 6006 --host 0.0.0.0 &
if ${resume_flag}; then # if ${resume_flag}; then
echo "トレーニング再開。バッチサイズ: ${batch_size}" # echo "トレーニング再開。バッチサイズ: ${batch_size}。"
python3 train_ms.py -c configs/train_config.json -m vc # python3 train_ms.py -c configs/train_config.json -m vc
else # else
echo "トレーニング開始。バッチサイズ: ${batch_size}" # 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 # 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 # fi
if $voice_change_flag; then # if $voice_change_flag; then
if [[ -z "$config" ]]; then # if [[ -z "$config" ]]; then
warn "コンフィグファイル(-c)を指定してください" # warn "コンフィグファイル(-c)を指定してください"
fi # fi
if [[ -z "$model" ]]; then # if [[ -z "$model" ]]; then
warn "モデルファイル(-m)を指定してください" # warn "モデルファイル(-m)を指定してください"
fi # fi
cd /voice-changer-internal/voice-change-service # cd /voice-changer-internal/voice-change-service
cp -r /resources/* . # cp -r /resources/* .
if [[ -e ./setting.json ]]; then # if [[ -e ./setting.json ]]; then
cp ./setting.json ../frontend/dist/assets/setting.json # cp ./setting.json ../frontend/dist/assets/setting.json
fi # fi
echo "-----------!!" # echo "-----------!!"
echo $config $model # echo $config $model
echo $model # echo $model
python3 serverSIO.py 8080 $config $model # python3 serverSIO.py 8080 $config $model
fi # fi

View File

@ -15,6 +15,6 @@ groupmod -g $GROUP_ID user
#su user #su user
# echo "parameter: $@" # echo "parameter: $@"
# exec /usr/sbin/gosu user /bin/bash exec.sh "$@" exec /usr/sbin/gosu user /bin/bash exec.sh "$@"
/bin/bash #/bin/bash