From baf8f14dc09c1012a8f56c8430987dcac28af7c2 Mon Sep 17 00:00:00 2001 From: zhangxiaoxiao <zhangxiaoxiao16@huawei.com> Date: Wed, 17 Nov 2021 12:06:32 +0800 Subject: [PATCH] c3d bug fix modified: official/cv/c3d/README.md --- official/cv/c3d/README.md | 8 +++++--- official/cv/c3d/default_config.yaml | 4 ++-- official/cv/c3d/preprocess.py | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/official/cv/c3d/README.md b/official/cv/c3d/README.md index 1b8738b40..81159d121 100644 --- a/official/cv/c3d/README.md +++ b/official/cv/c3d/README.md @@ -425,11 +425,13 @@ eval result: top_1 79.381% ### [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] --mindir_file_name [FILE_NAME] --file_format [FILE_FORMAT] --num_classes [NUM_CLASSES] --batch_size [BATCH_SIZE] ``` -The ckpt_file parameter is required, -`file_format` should be in ["AIR", "MINDIR"] +- `ckpt_file` parameter is mandotory. +- `file_format` should be in ["AIR", "MINDIR"]. +- `NUM_CLASSES` Number of total classes in the dataset, 51 for HMDB51 and 101 for UCF101. +- `BATCH_SIZE` Since currently mindir does not support dynamic shapes, this network only supports inference with batch_size of 1. ### Infer on Ascend310 diff --git a/official/cv/c3d/default_config.yaml b/official/cv/c3d/default_config.yaml index d547a2826..4690d0746 100644 --- a/official/cv/c3d/default_config.yaml +++ b/official/cv/c3d/default_config.yaml @@ -58,5 +58,5 @@ mindir_file_name: 'C3D' # Save file path file_format: 'MINDIR' # Save file format # 310 infer -pre_result_path: './pre_result_path' # Mindspore ckpt file path -post_result_path: './result_Files' # Save file path +pre_result_path: './preprocess_Result' # save preprocess result file path +post_result_path: './result_Files' # Save postprocess result file path diff --git a/official/cv/c3d/preprocess.py b/official/cv/c3d/preprocess.py index ab501930e..8a8de2150 100644 --- a/official/cv/c3d/preprocess.py +++ b/official/cv/c3d/preprocess.py @@ -31,7 +31,6 @@ def gen_bin(data_dir): image_path = os.path.join(data_dir, "image") label_path = os.path.join(data_dir, "label_bs" + str(config.batch_size) + ".npy") - os.makedirs(image_path) label_list = [] for index, (input_data, label) in enumerate(dataset): -- GitLab