diff --git a/official/nlp/lstm/README.md b/official/nlp/lstm/README.md index 01c3055c812a3842c01b666bd0d43c2671b11d72..5ae345ca4658a9deef480cec08a82a0e11c773b4 100644 --- a/official/nlp/lstm/README.md +++ b/official/nlp/lstm/README.md @@ -419,7 +419,7 @@ Ascend: python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] --config_path [YAML_CONFIG_PATH] ``` -- `weight.txt` is required, please generate it by run preprocess.py. Then you will see this file in /preprocess. +- `weight.txt` is required, it will be generated with mindrecords by training model. - `ckpt_file` parameter is required. - `FILE_FORMAT` should be in ["AIR", "MINDIR", "ONNX"]. - `YAML_CONFIG_PATH` default is `default_config.yaml`. diff --git a/official/nlp/lstm/README_CN.md b/official/nlp/lstm/README_CN.md index 7972a64fb59a999a2f4e9553c6b02867b29fc85b..fb7e133b5c586a792969bf2f6389a26eeefa628d 100644 --- a/official/nlp/lstm/README_CN.md +++ b/official/nlp/lstm/README_CN.md @@ -421,7 +421,7 @@ Ascend: python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] --config_path [YAML_CONFIG_PATH] ``` -- `weight.txt` 文件在导出脚本中要用到,需要运行preprocess.py文件生成。 +- `weight.txt` 文件需要在训练模型时获得。 - `ckpt_file` 是必需的。 - `FILE_FORMAT` 必须在 ["AIR", "MINDIR", "ONNX"]中进行选择。 - `YAML_CONFIG_PATH` 默认是 `default_config.yaml`。 diff --git a/official/nlp/lstm/preprocess.py b/official/nlp/lstm/preprocess.py index 6a1b82e98f3a1c3a3c8e7913d686fb339377a53f..9c39fd03b56b4aefa9d22882a5def0bb8db50ea5 100644 --- a/official/nlp/lstm/preprocess.py +++ b/official/nlp/lstm/preprocess.py @@ -18,13 +18,12 @@ import os import numpy as np -from src.dataset import lstm_create_dataset, convert_to_mindrecord +from src.dataset import lstm_create_dataset from src.model_utils.config import config if __name__ == '__main__': print("============== Starting Data Pre-processing ==============") - convert_to_mindrecord(config.embed_size, config.aclimdb_path, config.preprocess_path, config.glove_path) dataset = lstm_create_dataset(config.preprocess_path, config.batch_size, training=False) img_path = os.path.join(config.result_path, "00_data") os.makedirs(img_path)