diff --git a/samples/cpp/speech_sample/README.md b/samples/cpp/speech_sample/README.md index 8a1a52244b3fbd..e12cadb59efd04 100644 --- a/samples/cpp/speech_sample/README.md +++ b/samples/cpp/speech_sample/README.md @@ -106,18 +106,19 @@ Options: -pc Optional. Enables per-layer performance report. -q "" Optional. Input quantization mode: static (default), dynamic, or user (use with -sf). -qb "" Optional. Weight bits for quantization: 8 or 16 (default) - -sf "" Optional. User-specified input scale factor for quantization (use with -q user). If the network contains multiple inputs, provide scale factors by separating them with commas. - -bs "" Optional. Batch size 1-8 - -layout "" Optional. Prompts how network layouts should be treated by application.For example, \"input1[NCHW],input2[NC]\" or \"[NCHW]\" in case of one input size. + -sf "" Optional. User-specified input scale factor for quantization (use with -q user). If the network contains multiple inputs, provide scale factors by separating them with commas. For example: :,: or just to be applied to all inputs + -bs "" Optional. Batch size 1-8 (default 1) -r "" Optional. Read reference score file or named layers with corresponding score files and compare scores. Example of usage for single file: or . Example of usage for named layers: Example of usage for named layers: =,=. -rg "" Read GNA model from file using path/filename provided (required if -m is missing). -wg "" Optional. Write GNA model to file using path/filename provided. -we "" Optional. Write GNA embedded model to file using path/filename provided. -cw_l "" Optional. Number of frames for left context windows (default is 0). Works only with context window networks. If you use the cw_l or cw_r flag, then batch size argument is ignored. -cw_r "" Optional. Number of frames for right context windows (default is 0). Works only with context window networks. If you use the cw_r or cw_l flag, then batch size argument is ignored. + -layout "" Optional. Prompts how network layouts should be treated by application. For example, "input1[NCHW],input2[NC]" or "[NCHW]" in case of one input size. -pwl_me "" Optional. The maximum percent of error for PWL function.The value must be in <0, 100> range. The default value is 1.0. -exec_target "" Optional. Specify GNA execution target generation. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. By default, generation corresponds to the GNA HW available in the system or the latest fully supported generation by the software. See the GNA Plugin's GNA_EXEC_TARGET config option description. -compile_target "" Optional. Specify GNA compile target generation. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. By default, generation corresponds to the GNA HW available in the system or the latest fully supported generation by the software. See the GNA Plugin's GNA_COMPILE_TARGET config option description. + -memory_reuse_off Optional. Disables memory optimizations for compiled model. Available target devices: CPU GNA GPU VPUX ``` @@ -132,9 +133,9 @@ mo --framework kaldi --input_model wsj_dnn5b.nnet --counts wsj_dnn5b.counts --re The following pre-trained models are available: -- wsj_dnn5b_smbr -- rm_lstm4f - rm_cnn4a_smbr +- rm_lstm4f +- wsj_dnn5b_smbr All of them can be downloaded from [https://storage.openvinotoolkit.org/models_contrib/speech/2021.2](https://storage.openvinotoolkit.org/models_contrib/speech/2021.2). diff --git a/samples/cpp/speech_sample/main.cpp b/samples/cpp/speech_sample/main.cpp index 17b06e6984cb6c..9dffa204e1aacb 100644 --- a/samples/cpp/speech_sample/main.cpp +++ b/samples/cpp/speech_sample/main.cpp @@ -343,14 +343,22 @@ int main(int argc, char* argv[]) { if (output_name_files.size() != outputs.size() && outputs.size()) { throw std::logic_error("The number of output files is not equal to the number of network outputs."); } - count_file = output_name_files.empty() ? 1 : output_name_files.size(); + count_file = output_name_files.size(); + if (executableNet.outputs().size() > 1 && output_data.second.empty() && count_file == 1) { + throw std::logic_error("-o is ambiguous: the model has multiple outputs but only one file provided " + "without output name specification"); + } } if (!reference_data.first.empty()) { reference_name_files = convert_str_to_vector(reference_data.first); if (reference_name_files.size() != outputs.size() && outputs.size()) { throw std::logic_error("The number of reference files is not equal to the number of network outputs."); } - count_file = reference_name_files.empty() ? 1 : reference_name_files.size(); + count_file = reference_name_files.size(); + if (executableNet.outputs().size() > 1 && reference_data.second.empty() && count_file == 1) { + throw std::logic_error("-r is ambiguous: the model has multiple outputs but only one file provided " + "without output name specification"); + } } if (count_file > executableNet.outputs().size()) { throw std::logic_error( diff --git a/samples/cpp/speech_sample/speech_sample.hpp b/samples/cpp/speech_sample/speech_sample.hpp index 539ca4a5c8b9d4..093d42ea904e4f 100644 --- a/samples/cpp/speech_sample/speech_sample.hpp +++ b/samples/cpp/speech_sample/speech_sample.hpp @@ -62,14 +62,14 @@ static const char custom_cpu_library_message[] = "Required for CPU plugin custom /// @brief message for score output argument static const char output_message[] = "Optional. Output file name to save scores or Layer names with corresponding files names to save scores. Example " - "of usage for single file: or . Example of usage for named layers: Example of usage for " - "named layers: =,=."; + "of usage for single file: or . Example of usage for named layers: " + "=,=."; /// @brief message for reference score file argument static const char reference_score_message[] = "Optional. Read reference score file or named layers with corresponding score files and compare scores. Example of " - "usage for single file: or . Example of usage for named layers: Example of usage " - "for named layers: =,=."; + "usage for single file: or . Example of usage for named layers: " + "=,=."; /// @brief message for read GNA model argument static const char read_gna_model_message[] = @@ -89,7 +89,7 @@ static const char write_embedded_model_generation_message[] = /// @brief message for quantization argument static const char quantization_message[] = - "Optional. Input quantization mode: static (default), dynamic, or user (use with -sf)."; + "Optional. Input quantization mode: static (default), dynamic, or user (use with -sf)."; /// @brief message for quantization bits argument static const char quantization_bits_message[] = "Optional. Weight bits for quantization: 8 or 16 (default)"; @@ -222,7 +222,7 @@ static void show_usage() { std::cout << " -pwl_me \"\" " << pwl_max_error_percent_message << std::endl; std::cout << " -exec_target \"\" " << execution_target_message << std::endl; std::cout << " -compile_target \"\" " << compile_target_message << std::endl; - std::cout << " -memory_reuse_off " << memory_reuse_message << std::endl; + std::cout << " -memory_reuse_off " << memory_reuse_message << std::endl; } /** diff --git a/samples/python/speech_sample/README.md b/samples/python/speech_sample/README.md index 2311f01259fa20..f9add6fc1a645b 100644 --- a/samples/python/speech_sample/README.md +++ b/samples/python/speech_sample/README.md @@ -161,9 +161,9 @@ mo --framework kaldi --input_model wsj_dnn5b.nnet --counts wsj_dnn5b.counts --re The following pre-trained models are available: -- wsj_dnn5b_smbr -- rm_lstm4f - rm_cnn4a_smbr +- rm_lstm4f +- wsj_dnn5b_smbr All of them can be downloaded from [https://storage.openvinotoolkit.org/models_contrib/speech/2021.2](https://storage.openvinotoolkit.org/models_contrib/speech/2021.2).