File size: 1,106 Bytes
6931c7b |
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 |
#!/bin/sh
set -x
set -e
export OMP_NUM_THREADS=4
export MKL_NUM_THREADS=4
export NUMEXPR_NUM_THREADS=4
export KMP_INIT_AT_FORK=FALSE
PYTHON=python3
exp_name=$1
config=$2
dataset=$3
stage=$4
if [ "${stage}" == "s1" ]; then
TRAIN_CODE=train_multi_vq.py
echo "Training for Discrete Motion Prior"
else
TRAIN_CODE=train_multi_pred.py
TEST_CODE=test_multi_pred.py
echo "Training for Speech-Driven Motion Synthesis"
fi
exp_dir=logs/${dataset}/${exp_name}
model_dir=${exp_dir}/model
result_dir=${exp_dir}/result
now=$(date +"%Y%m%d_%H%M%S")
mkdir -p ${model_dir} ${result_dir}
mkdir -p ${exp_dir}/result
export PYTHONPATH=./
echo $OMP_NUM_THREADS | tee -a ${exp_dir}/train-$now.log
nvidia-smi | tee -a ${exp_dir}/train-$now.log
which pip | tee -a ${exp_dir}/train-$now.log
## TRAIN
$PYTHON -u main/${TRAIN_CODE} \
--config=${config} \
save_path ${exp_dir} \
2>&1 | tee -a ${exp_dir}/train-$now.log
## TEST
$PYTHON -u main/${TEST_CODE} \
--config=${config} \
save_folder ${exp_dir}/result \
model_path ${model_dir}/model.pth.tar \
2>&1 | tee -a ${exp_dir}/test-$now.log |