From 96955632f25c2f0833becb410574529540a93333 Mon Sep 17 00:00:00 2001 From: huchunmei Date: Sat, 3 Jul 2021 17:33:47 +0800 Subject: [PATCH] clould --- model_zoo/official/nlp/lstm/config_ascend.yaml | 2 +- model_zoo/official/nlp/lstm/config_ascend_8p.yaml | 2 +- model_zoo/official/nlp/lstm/default_config.yaml | 2 +- model_zoo/official/nlp/lstm/scripts/run_eval_ascend.sh | 4 ++-- model_zoo/official/nlp/lstm/scripts/run_eval_cpu.sh | 2 +- model_zoo/official/nlp/lstm/scripts/run_eval_gpu.sh | 2 +- .../official/recommend/wide_and_deep/train_and_eval.py | 2 +- .../wide_and_deep/train_and_eval_auto_parallel.py | 2 +- .../recommend/wide_and_deep/train_and_eval_distribute.py | 2 +- .../train_and_eval_parameter_server_distribute.py | 7 ++++--- .../train_and_eval_parameter_server_standalone.py | 7 ++++--- 11 files changed, 18 insertions(+), 16 deletions(-) diff --git a/model_zoo/official/nlp/lstm/config_ascend.yaml b/model_zoo/official/nlp/lstm/config_ascend.yaml index 01d6827c4fb..3c6ad8cbd5e 100644 --- a/model_zoo/official/nlp/lstm/config_ascend.yaml +++ b/model_zoo/official/nlp/lstm/config_ascend.yaml @@ -33,7 +33,7 @@ global_step: 0 # MindSpore LSTM Example - train.py preprocess: 'false' -aclimdb_path: "/cache/data/aclImdb" +aclimdb_path: "./aclImdb" glove_path: "/cache/data" preprocess_path: "/cache/train/preprocess" ckpt_path: './ckpt_lstm/' diff --git a/model_zoo/official/nlp/lstm/config_ascend_8p.yaml b/model_zoo/official/nlp/lstm/config_ascend_8p.yaml index 21437430292..0067383a45d 100644 --- a/model_zoo/official/nlp/lstm/config_ascend_8p.yaml +++ b/model_zoo/official/nlp/lstm/config_ascend_8p.yaml @@ -34,7 +34,7 @@ global_step: 0 # MindSpore LSTM Example - train.py preprocess: 'false' -aclimdb_path: "/cache/data/aclImdb" +aclimdb_path: "./aclImdb" glove_path: "/cache/data" preprocess_path: "/cache/train/preprocess" ckpt_path: './ckpt_lstm/' diff --git a/model_zoo/official/nlp/lstm/default_config.yaml b/model_zoo/official/nlp/lstm/default_config.yaml index 6ae61832028..a94b1544db6 100644 --- a/model_zoo/official/nlp/lstm/default_config.yaml +++ b/model_zoo/official/nlp/lstm/default_config.yaml @@ -28,7 +28,7 @@ keep_checkpoint_max: 10 # MindSpore LSTM Example - train.py preprocess: 'false' -aclimdb_path: "/cache/data/aclImdb" +aclimdb_path: "./aclImdb" glove_path: "/cache/data" preprocess_path: "/cache/train/preprocess" ckpt_path: './ckpt_lstm/' diff --git a/model_zoo/official/nlp/lstm/scripts/run_eval_ascend.sh b/model_zoo/official/nlp/lstm/scripts/run_eval_ascend.sh index c3719fb63a6..3597792957b 100644 --- a/model_zoo/official/nlp/lstm/scripts/run_eval_ascend.sh +++ b/model_zoo/official/nlp/lstm/scripts/run_eval_ascend.sh @@ -39,6 +39,6 @@ CONFIG_FILE="${BASE_PATH}/../../config_ascend.yaml" python ../../eval.py \ --config_path=$CONFIG_FILE \ --device_target="Ascend" \ - --preprocess=true \ - --glove_path=$PREPROCESS_DIR \ + --preprocess=false \ + --preprocess_path=$PREPROCESS_DIR \ --ckpt_file=$CKPT_FILE > log.txt 2>&1 & diff --git a/model_zoo/official/nlp/lstm/scripts/run_eval_cpu.sh b/model_zoo/official/nlp/lstm/scripts/run_eval_cpu.sh index 0b628c9f07f..f0fbbfd2374 100644 --- a/model_zoo/official/nlp/lstm/scripts/run_eval_cpu.sh +++ b/model_zoo/official/nlp/lstm/scripts/run_eval_cpu.sh @@ -37,6 +37,6 @@ python ../eval.py \ --device_target="CPU" \ --aclimdb_path=$ACLIMDB_DIR \ --glove_path=$GLOVE_DIR \ - --preprocess=true \ + --preprocess=false \ --preprocess_path=./preprocess \ --ckpt_file=$CKPT_FILE > log.txt 2>&1 & diff --git a/model_zoo/official/nlp/lstm/scripts/run_eval_gpu.sh b/model_zoo/official/nlp/lstm/scripts/run_eval_gpu.sh index 32f151bafe4..2f9239ccec5 100644 --- a/model_zoo/official/nlp/lstm/scripts/run_eval_gpu.sh +++ b/model_zoo/official/nlp/lstm/scripts/run_eval_gpu.sh @@ -40,6 +40,6 @@ python ../eval.py \ --device_target="GPU" \ --aclimdb_path=$ACLIMDB_DIR \ --glove_path=$GLOVE_DIR \ - --preprocess=true \ + --preprocess=false \ --preprocess_path=./preprocess \ --ckpt_file=$CKPT_FILE > log.txt 2>&1 & diff --git a/model_zoo/official/recommend/wide_and_deep/train_and_eval.py b/model_zoo/official/recommend/wide_and_deep/train_and_eval.py index 74efc221009..3439055e5d9 100644 --- a/model_zoo/official/recommend/wide_and_deep/train_and_eval.py +++ b/model_zoo/official/recommend/wide_and_deep/train_and_eval.py @@ -104,7 +104,7 @@ def test_train_eval(config): def modelarts_pre_process(): - config.ckpt_path = config.output_path + cfg.ckpt_path = cfg.output_path @moxing_wrapper(pre_process=modelarts_pre_process) def train_wide_and_deep(): diff --git a/model_zoo/official/recommend/wide_and_deep/train_and_eval_auto_parallel.py b/model_zoo/official/recommend/wide_and_deep/train_and_eval_auto_parallel.py index 657c3d59db4..3a23b14a197 100644 --- a/model_zoo/official/recommend/wide_and_deep/train_and_eval_auto_parallel.py +++ b/model_zoo/official/recommend/wide_and_deep/train_and_eval_auto_parallel.py @@ -144,7 +144,7 @@ def train_and_eval(config): def modelarts_pre_process(): - config.ckpt_path = config.output_path + cfg.ckpt_path = cfg.output_path @moxing_wrapper(pre_process=modelarts_pre_process) def train_wide_and_deep(): diff --git a/model_zoo/official/recommend/wide_and_deep/train_and_eval_distribute.py b/model_zoo/official/recommend/wide_and_deep/train_and_eval_distribute.py index d9818098fed..dbd5a3d7dfe 100644 --- a/model_zoo/official/recommend/wide_and_deep/train_and_eval_distribute.py +++ b/model_zoo/official/recommend/wide_and_deep/train_and_eval_distribute.py @@ -118,7 +118,7 @@ def train_and_eval(config): def modelarts_pre_process(): - config.ckpt_path = config.output_path + cfg.ckpt_path = cfg.output_path @moxing_wrapper(pre_process=modelarts_pre_process) def train_wide_and_deep(): diff --git a/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_distribute.py b/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_distribute.py index 3a62b03d85f..85707de7664 100644 --- a/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_distribute.py +++ b/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_distribute.py @@ -145,13 +145,14 @@ def train_and_eval(config): def modelarts_pre_process(): - config.ckpt_path = config.output_path + cfg.ckpt_path = cfg.output_path + +context.set_context(mode=context.GRAPH_MODE, device_target=cfg.device_target, save_graphs=True) +cache_enable = cfg.vocab_cache_size > 0 @moxing_wrapper(pre_process=modelarts_pre_process) def train_wide_and_deep(): """ train_wide_and_deep """ - context.set_context(mode=context.GRAPH_MODE, device_target=cfg.device_target, save_graphs=True) - cache_enable = cfg.vocab_cache_size > 0 if cache_enable and cfg.device_target != "GPU": context.set_context(variable_memory_max_size="24GB") context.set_ps_context(enable_ps=True) diff --git a/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_standalone.py b/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_standalone.py index 7f21f8ff05f..7b68bcd2ef2 100644 --- a/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_standalone.py +++ b/model_zoo/official/recommend/wide_and_deep/train_and_eval_parameter_server_standalone.py @@ -117,13 +117,14 @@ def train_and_eval(config): def modelarts_pre_process(): - config.ckpt_path = config.output_path + cfg.ckpt_path = cfg.output_path + +context.set_context(mode=context.GRAPH_MODE, device_target=cfg.device_target, save_graphs=True) +cache_enable = cfg.vocab_cache_size > 0 @moxing_wrapper(pre_process=modelarts_pre_process) def train_wide_and_deep(): """ train_wide_and_deep """ - context.set_context(mode=context.GRAPH_MODE, device_target=cfg.device_target, save_graphs=True) - cache_enable = cfg.vocab_cache_size > 0 if not cache_enable: cfg.sparse = True if cfg.sparse: