diff --git a/model_zoo/official/nlp/gru/README.md b/model_zoo/official/nlp/gru/README.md index 1e2f99a7b08..9958dec152c 100644 --- a/model_zoo/official/nlp/gru/README.md +++ b/model_zoo/official/nlp/gru/README.md @@ -217,7 +217,7 @@ Parameters for both training and evaluation can be set in config.py. All the dat perl multi-bleu.perl target.txt.forbleu < output.txt.forbleu ``` -Note: The `DATASET_PATH` is path to mindrecord. eg. /dataset_path/*.mindrecord +Note: The `DATASET_PATH` is path to mindrecord. eg. train: /dataset_path/multi30k_train_mindrecord_0 eval: /dataset_path/multi30k_test_mindrecord # [Model Description](#content) diff --git a/model_zoo/official/nlp/gru/eval.py b/model_zoo/official/nlp/gru/eval.py index 6fc8cb083dd..66407aa671e 100644 --- a/model_zoo/official/nlp/gru/eval.py +++ b/model_zoo/official/nlp/gru/eval.py @@ -41,8 +41,7 @@ def run_gru_eval(): context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, reserve_class_name_in_scope=False, \ device_id=args.device_id, save_graphs=False) - prefix = "multi30k_test_mindrecord_32" - mindrecord_file = os.path.join(args.dataset_path, prefix) + mindrecord_file = args.dataset_path if not os.path.exists(mindrecord_file): print("dataset file {} not exists, please check!".format(mindrecord_file)) raise ValueError(mindrecord_file) diff --git a/model_zoo/official/nlp/gru/scripts/run_distribute_train_ascend.sh b/model_zoo/official/nlp/gru/scripts/run_distribute_train_ascend.sh index 04830cc32b1..c9280d7e48f 100644 --- a/model_zoo/official/nlp/gru/scripts/run_distribute_train_ascend.sh +++ b/model_zoo/official/nlp/gru/scripts/run_distribute_train_ascend.sh @@ -40,9 +40,9 @@ fi DATASET_PATH=$(get_real_path $2) echo $DATASET_PATH -if [ ! -d $DATASET_PATH ] +if [ ! -f $DATASET_PATH ] then - echo "error: DATASET_PATH=$DATASET_PATH is not a directory" + echo "error: DATASET_PATH=$DATASET_PATH is not a file" exit 1 fi diff --git a/model_zoo/official/nlp/gru/scripts/run_eval.sh b/model_zoo/official/nlp/gru/scripts/run_eval.sh index 599d934fa86..5b0f7defeda 100644 --- a/model_zoo/official/nlp/gru/scripts/run_eval.sh +++ b/model_zoo/official/nlp/gru/scripts/run_eval.sh @@ -41,9 +41,9 @@ fi DATASET_PATH=$(get_real_path $2) echo $DATASET_PATH -if [ ! -d $DATASET_PATH ] +if [ ! -f $DATASET_PATH ] then - echo "error: DATASET_PATH=$DATASET_PATH is not a directory" + echo "error: DATASET_PATH=$DATASET_PATH is not a file" exit 1 fi rm -rf ./eval diff --git a/model_zoo/official/nlp/gru/scripts/run_standalone_train.sh b/model_zoo/official/nlp/gru/scripts/run_standalone_train.sh index b2fbc878afc..0c5cca14617 100644 --- a/model_zoo/official/nlp/gru/scripts/run_standalone_train.sh +++ b/model_zoo/official/nlp/gru/scripts/run_standalone_train.sh @@ -33,9 +33,9 @@ get_real_path(){ DATASET_PATH=$(get_real_path $1) echo $DATASET_PATH -if [ ! -d $DATASET_PATH ] +if [ ! -f $DATASET_PATH ] then - echo "error: DATASET_PATH=$DATASET_PATH is not a directory" + echo "error: DATASET_PATH=$DATASET_PATH is not a file" exit 1 fi diff --git a/model_zoo/official/nlp/gru/train.py b/model_zoo/official/nlp/gru/train.py index d4f362a0730..9fc64224d81 100644 --- a/model_zoo/official/nlp/gru/train.py +++ b/model_zoo/official/nlp/gru/train.py @@ -99,8 +99,7 @@ if __name__ == '__main__': else: rank = 0 device_num = 1 - prefix = "multi30k_train_mindrecord_32_" - mindrecord_file = os.path.join(args.dataset_path, prefix+"0") + mindrecord_file = args.dataset_path if not os.path.exists(mindrecord_file): print("dataset file {} not exists, please check!".format(mindrecord_file)) raise ValueError(mindrecord_file)