From 08b28044c6b619a1884a46fae9b789c2edd41e45 Mon Sep 17 00:00:00 2001 From: zhangxiaoxiao <zhangxiaoxiao16@huawei.com> Date: Thu, 9 Dec 2021 17:16:35 +0800 Subject: [PATCH] air to mindir --- official/cv/alexnet/config_imagenet.yaml | 2 +- official/cv/alexnet/default_config.yaml | 2 +- official/cv/centerface/default_config.yaml | 2 +- official/cv/deeplabv3/default_config.yaml | 2 +- official/cv/faster_rcnn/default_config.yaml | 2 +- official/cv/faster_rcnn/default_config_101.yaml | 2 +- official/cv/faster_rcnn/default_config_152.yaml | 2 +- .../default_config_InceptionResnetV2.yaml | 2 +- official/cv/maskrcnn/default_config.yaml | 2 +- official/cv/vgg16/cifar10_config.yaml | 2 +- official/cv/vgg16/imagenet2012_config.yaml | 2 +- official/cv/yolov3_darknet53/default_config.yaml | 2 +- official/cv/yolov3_resnet18/default_config.yaml | 2 +- official/cv/yolov4/default_config.yaml | 2 +- official/nlp/lstm/README.md | 7 ++++--- official/nlp/lstm/README_CN.md | 12 +++++++----- 16 files changed, 25 insertions(+), 22 deletions(-) diff --git a/official/cv/alexnet/config_imagenet.yaml b/official/cv/alexnet/config_imagenet.yaml index 338e94f3b..3fc83ab26 100644 --- a/official/cv/alexnet/config_imagenet.yaml +++ b/official/cv/alexnet/config_imagenet.yaml @@ -34,7 +34,7 @@ is_dynamic_loss_scale: 0 # Model Description model_name: alexnet file_name: 'alexnet' -file_format: 'AIR' +file_format: 'MINDIR' dataset_name: 'imagenet' sink_size: -1 diff --git a/official/cv/alexnet/default_config.yaml b/official/cv/alexnet/default_config.yaml index c254a8af2..d686f43c2 100644 --- a/official/cv/alexnet/default_config.yaml +++ b/official/cv/alexnet/default_config.yaml @@ -38,7 +38,7 @@ lr: 0.01 # Model Description model_name: alexnet file_name: 'alexnet' -file_format: 'AIR' +file_format: 'MINDIR' --- diff --git a/official/cv/centerface/default_config.yaml b/official/cv/centerface/default_config.yaml index 11c3a9ddd..20129d9a1 100644 --- a/official/cv/centerface/default_config.yaml +++ b/official/cv/centerface/default_config.yaml @@ -126,7 +126,7 @@ device_id: 0 batch_size: 1 ckpt_file: '' file_name: "centerface" -file_format: 'AIR' +file_format: 'MINDIR' # centerface preprocess" dataset_path: '' diff --git a/official/cv/deeplabv3/default_config.yaml b/official/cv/deeplabv3/default_config.yaml index 7861e3177..9859942c0 100644 --- a/official/cv/deeplabv3/default_config.yaml +++ b/official/cv/deeplabv3/default_config.yaml @@ -63,7 +63,7 @@ export_batch_size: 1 input_size: 513 ckpt_file: "" file_name: "deeplabv3" -file_format: "AIR" +file_format: "MINDIR" export_model: "deeplab_v3_s8" --- diff --git a/official/cv/faster_rcnn/default_config.yaml b/official/cv/faster_rcnn/default_config.yaml index d9f21c745..0ed7dcee5 100644 --- a/official/cv/faster_rcnn/default_config.yaml +++ b/official/cv/faster_rcnn/default_config.yaml @@ -166,7 +166,7 @@ checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # export.py fasterrcnn_export file_name: "faster_rcnn" -file_format: "AIR" +file_format: "MINDIR" ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # postprocess ("./src/config_50.yaml") diff --git a/official/cv/faster_rcnn/default_config_101.yaml b/official/cv/faster_rcnn/default_config_101.yaml index 2ca34b2c8..e6ef0dffe 100644 --- a/official/cv/faster_rcnn/default_config_101.yaml +++ b/official/cv/faster_rcnn/default_config_101.yaml @@ -167,7 +167,7 @@ checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # export.py fasterrcnn_export file_name: "faster_rcnn" -file_format: "AIR" +file_format: "MINDIR" ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # postprocess ("./src/config_50.yaml") diff --git a/official/cv/faster_rcnn/default_config_152.yaml b/official/cv/faster_rcnn/default_config_152.yaml index 76575493e..78fa68afc 100644 --- a/official/cv/faster_rcnn/default_config_152.yaml +++ b/official/cv/faster_rcnn/default_config_152.yaml @@ -167,7 +167,7 @@ checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # export.py fasterrcnn_export file_name: "faster_rcnn" -file_format: "AIR" +file_format: "MINDIR" ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt" # postprocess ("./src/config_50.yaml") diff --git a/official/cv/faster_rcnn/default_config_InceptionResnetV2.yaml b/official/cv/faster_rcnn/default_config_InceptionResnetV2.yaml index a755d1dd2..0c799d3ca 100644 --- a/official/cv/faster_rcnn/default_config_InceptionResnetV2.yaml +++ b/official/cv/faster_rcnn/default_config_InceptionResnetV2.yaml @@ -165,7 +165,7 @@ checkpoint_path: "/cache/checkpoint_path/faster_rcnn-20_7393.ckpt" # export.py fasterrcnn_export file_name: "faster_rcnn" -file_format: "AIR" +file_format: "MINDIR" ckpt_file: "" # postprocess ("./src/default_config_InceptionResnetV2.yaml") diff --git a/official/cv/maskrcnn/default_config.yaml b/official/cv/maskrcnn/default_config.yaml index 624491f8e..7410f4828 100644 --- a/official/cv/maskrcnn/default_config.yaml +++ b/official/cv/maskrcnn/default_config.yaml @@ -179,7 +179,7 @@ rank_id: 0 # maskrcnn export file_name: "maskrcnn" -file_format: "AIR" +file_format: "MINDIR" ckpt_file: '/cache/data/cocodataset/ckpt_maskrcnn/mask_rcnn-12_7393.ckpt' ckpt_file_local: './maskrcnn/scripts/train_parallel0/ckpt_0/mask_rcnn-12_7393.ckpt' diff --git a/official/cv/vgg16/cifar10_config.yaml b/official/cv/vgg16/cifar10_config.yaml index dfc437db4..d49b91873 100644 --- a/official/cv/vgg16/cifar10_config.yaml +++ b/official/cv/vgg16/cifar10_config.yaml @@ -67,7 +67,7 @@ result_path: "./preprocess_Result/" # export options ckpt_file: "" file_name: "vgg16" -file_format: "AIR" +file_format: "MINDIR" --- diff --git a/official/cv/vgg16/imagenet2012_config.yaml b/official/cv/vgg16/imagenet2012_config.yaml index cfd51c5d3..c02cb8a7b 100644 --- a/official/cv/vgg16/imagenet2012_config.yaml +++ b/official/cv/vgg16/imagenet2012_config.yaml @@ -67,7 +67,7 @@ result_path: "./preprocess_Result/" # export options ckpt_file: "" file_name: "vgg16" -file_format: "AIR" +file_format: "MINDIR" --- diff --git a/official/cv/yolov3_darknet53/default_config.yaml b/official/cv/yolov3_darknet53/default_config.yaml index 070fa4fb0..751d65693 100644 --- a/official/cv/yolov3_darknet53/default_config.yaml +++ b/official/cv/yolov3_darknet53/default_config.yaml @@ -74,7 +74,7 @@ device_id: 0 batch_size: 1 ckpt_file: "" file_name: "yolov3_darknet53" -file_format: "AIR" # ["AIR", "ONNX", "MINDIR"] +file_format: "MINDIR" # ["AIR", "ONNX", "MINDIR"] keep_detect: True # PostProcess option diff --git a/official/cv/yolov3_resnet18/default_config.yaml b/official/cv/yolov3_resnet18/default_config.yaml index cdde38f74..ccf6158f1 100644 --- a/official/cv/yolov3_resnet18/default_config.yaml +++ b/official/cv/yolov3_resnet18/default_config.yaml @@ -38,7 +38,7 @@ device_id: 0 export_batch_size: 1 ckpt_file: "" file_name: "yolov3_resnet18" -file_format: "AIR" +file_format: "MINDIR" --- diff --git a/official/cv/yolov4/default_config.yaml b/official/cv/yolov4/default_config.yaml index 6b7f33303..9aa3120f2 100644 --- a/official/cv/yolov4/default_config.yaml +++ b/official/cv/yolov4/default_config.yaml @@ -63,7 +63,7 @@ batch_size: 1 testing_shape: 608 ckpt_file: "" file_name: "yolov4" -file_format: "AIR" +file_format: "MINDIR" keep_detect: True # Other default config diff --git a/official/nlp/lstm/README.md b/official/nlp/lstm/README.md index 094a2f424..5b5751977 100644 --- a/official/nlp/lstm/README.md +++ b/official/nlp/lstm/README.md @@ -399,11 +399,12 @@ Ascend: ## [Export MindIR](#contents) ```shell -python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] +python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] --config_path [YAML_CONFIG_PATH] ``` -The ckpt_file parameter is required, -`EXPORT_FORMAT` should be in ["AIR", "MINDIR"] +- `ckpt_file` parameter is required. +- `FILE_FORMAT` should be in ["AIR", "MINDIR"]. +- `YAML_CONFIG_PATH` default is `default_config.yaml`. ## [Inference Process](#contents) diff --git a/official/nlp/lstm/README_CN.md b/official/nlp/lstm/README_CN.md index 108d0657c..6b4e31d0d 100644 --- a/official/nlp/lstm/README_CN.md +++ b/official/nlp/lstm/README_CN.md @@ -400,10 +400,12 @@ Ascend: ## 瀵煎嚭mindir妯″瀷 ```shell -python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] +python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] --config_path [YAML_CONFIG_PATH] ``` -鍙傛暟`ckpt_file` 鏄繀闇€鐨勶紝`EXPORT_FORMAT` 蹇呴』鍦� ["AIR", "MINDIR"]涓繘琛岄€夋嫨銆� +- `ckpt_file` 鏄繀闇€鐨勩€� +- `FILE_FORMAT` 蹇呴』鍦� ["AIR", "MINDIR"]涓繘琛岄€夋嫨銆� +- `YAML_CONFIG_PATH` 榛樿鏄� `default_config.yaml`銆� ## 鎺ㄧ悊杩囩▼ @@ -416,9 +418,9 @@ python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [ bash run_infer_310.sh [MINDIR_PATH] [DATASET_PATH] [NEED_PREPROCESS] [DEVICE_TARGET] [DEVICE_ID] ``` -`DEVICE_TARGET` 鍙€夊€艰寖鍥翠负锛歔'GPU', 'CPU', 'Ascend'] -`NEED_PREPROCESS` 琛ㄧず鏁版嵁鏄惁闇€瑕侀澶勭悊锛屽彲閫夊€艰寖鍥翠负锛�'y' 鎴栬€� 'n' -`DEVICE_ID` 鍙€�, 榛樿鍊间负0. +- `DEVICE_TARGET` 鍙€夊€艰寖鍥翠负锛歔'GPU', 'CPU', 'Ascend'] +- `NEED_PREPROCESS` 琛ㄧず鏁版嵁鏄惁闇€瑕侀澶勭悊锛屽彲閫夊€艰寖鍥翠负锛�'y' 鎴栬€� 'n' +- `DEVICE_ID` 鍙€�, 榛樿鍊间负0 ### 缁撴灉 -- GitLab