From 32e2d06350aa26ce425c85776207ebc93dbd8f10 Mon Sep 17 00:00:00 2001 From: anzhengqi Date: Thu, 23 Dec 2021 19:11:53 +0800 Subject: [PATCH] fix some network ncf scripts error --- model_zoo/official/recommend/ncf/eval.py | 2 +- .../official/recommend/ncf/scripts/run_distribute_train.sh | 1 - .../recommend/ncf/scripts/run_transfer_ckpt_to_air.sh | 7 +++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/model_zoo/official/recommend/ncf/eval.py b/model_zoo/official/recommend/ncf/eval.py index 8f60b13995d..6c40ee9cb3c 100644 --- a/model_zoo/official/recommend/ncf/eval.py +++ b/model_zoo/official/recommend/ncf/eval.py @@ -81,7 +81,7 @@ def test_eval(): if __name__ == '__main__': - devid = int(os.getenv('DEVICE_ID')) + devid = int(os.getenv('DEVICE_ID', '0')) context.set_context(mode=context.GRAPH_MODE, device_target="Davinci", save_graphs=True, diff --git a/model_zoo/official/recommend/ncf/scripts/run_distribute_train.sh b/model_zoo/official/recommend/ncf/scripts/run_distribute_train.sh index ec0a7f67188..f15226210b5 100644 --- a/model_zoo/official/recommend/ncf/scripts/run_distribute_train.sh +++ b/model_zoo/official/recommend/ncf/scripts/run_distribute_train.sh @@ -36,7 +36,6 @@ do --dataset 'ml-1m' \ --train_epochs 50 \ --output_path './output/' \ - --eval_file_name 'eval.log' \ --loss_file_name 'loss.log' \ --checkpoint_path './checkpoint/' \ --device_target="Ascend" \ diff --git a/model_zoo/official/recommend/ncf/scripts/run_transfer_ckpt_to_air.sh b/model_zoo/official/recommend/ncf/scripts/run_transfer_ckpt_to_air.sh index fcd42247cee..fe8a4e4ad75 100644 --- a/model_zoo/official/recommend/ncf/scripts/run_transfer_ckpt_to_air.sh +++ b/model_zoo/official/recommend/ncf/scripts/run_transfer_ckpt_to_air.sh @@ -14,9 +14,8 @@ # limitations under the License. # ============================================================================ echo "Please run the script as: " -echo "sh scripts/run_transfer_ckpt_to_air.sh DATASET_PATH CKPT_FILE" -echo "for example: sh scripts/run_transfer_ckpt_to_air.sh /dataset_path /ncf.ckpt" +echo "sh scripts/run_transfer_ckpt_to_air.sh CKPT_FILE" +echo "for example: sh scripts/run_transfer_ckpt_to_air.sh /ncf.ckpt" -data_path=$1 ckpt_file=$2 -python ./src/export.py --data_path $data_path --dataset 'ml-1m' --eval_batch_size 160000 --output_path './output/' --eval_file_name 'eval.log' --checkpoint_file_path $ckpt_file \ No newline at end of file +python ./export.py --dataset 'ml-1m' --ckpt_file $ckpt_file