Summary: 1. Add missing is_local argument (when set False, use pserver). 2. Add exception thrown if cp failed. 3. Add cloud mkdir if not cloud path for uploading does not exist. 4. Fix a bug using common path ./local_manifest for all nodes. (convert to /local_manifest) 5. Refine coding style.pull/2/head
parent
b417681251
commit
0e79ee37a4
@ -0,0 +1,17 @@
|
||||
"""Set up paths for DS2"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
|
||||
def add_path(path):
|
||||
if path not in sys.path:
|
||||
sys.path.insert(0, path)
|
||||
|
||||
|
||||
this_dir = os.path.dirname(__file__)
|
||||
proj_path = os.path.join(this_dir, '..')
|
||||
add_path(proj_path)
|
@ -1,28 +1,36 @@
|
||||
DATA_PATH=$1
|
||||
MODEL_PATH=$2
|
||||
NUM_CPU=$3
|
||||
NUM_GPU=$4
|
||||
IS_LOCAL=$5
|
||||
|
||||
TRAIN_MANI=${DATA_PATH}/cloud.train.manifest
|
||||
DEV_MANI=${DATA_PATH}/cloud.test.manifest
|
||||
DEV_MANI=${DATA_PATH}/cloud.dev.manifest
|
||||
TRAIN_TAR=${DATA_PATH}/cloud.train.tar
|
||||
DEV_TAR=${DATA_PATH}/cloud.test.tar
|
||||
DEV_TAR=${DATA_PATH}/cloud.dev.tar
|
||||
VOCAB_PATH=${DATA_PATH}/vocab.txt
|
||||
MEAN_STD_FILE=${DATA_PATH}/mean_std.npz
|
||||
|
||||
# split train data for each pcloud node
|
||||
python ./cloud/split_data.py \
|
||||
--in_manifest_path=$TRAIN_MANI \
|
||||
--data_tar_path=$TRAIN_TAR \
|
||||
--out_manifest_path='./local.train.manifest'
|
||||
--in_manifest_path=${TRAIN_MANI} \
|
||||
--data_tar_path=${TRAIN_TAR} \
|
||||
--out_manifest_path='/local.train.manifest'
|
||||
|
||||
# split dev data for each pcloud node
|
||||
python ./cloud/split_data.py \
|
||||
--in_manifest_path=$DEV_MANI \
|
||||
--data_tar_path=$DEV_TAR \
|
||||
--out_manifest_path='./local.test.manifest'
|
||||
--in_manifest_path=${DEV_MANI} \
|
||||
--data_tar_path=${DEV_TAR} \
|
||||
--out_manifest_path='/local.dev.manifest'
|
||||
|
||||
# run train
|
||||
python train.py \
|
||||
--use_gpu=1 \
|
||||
--mean_std_filepath=$MEAN_STD_FILE \
|
||||
--train_manifest_path='./local.train.manifest' \
|
||||
--dev_manifest_path='./local.test.manifest' \
|
||||
--vocab_filepath=$VOCAB_PATH \
|
||||
--trainer_count=${NUM_GPU} \
|
||||
--num_threads_data=${NUM_CPU} \
|
||||
--is_local=${IS_LOCAL} \
|
||||
--mean_std_filepath=${MEAN_STD_FILE} \
|
||||
--train_manifest_path='/local.train.manifest' \
|
||||
--dev_manifest_path='/local.dev.manifest' \
|
||||
--vocab_filepath=${VOCAB_PATH} \
|
||||
--output_model_dir=${MODEL_PATH}
|
||||
|
Loading…
Reference in new issue