[GNA] fix custom scale factors when importing a model (#1096)
authorAnna Alberska <anna.alberska@intel.com>
Thu, 25 Jun 2020 09:43:47 +0000 (11:43 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2020 09:43:47 +0000 (12:43 +0300)
inference-engine/samples/speech_sample/main.cpp

index 58b4b98..36b4054 100644 (file)
@@ -603,12 +603,13 @@ int main(int argc, char *argv[]) {
 
         if (FLAGS_q.compare("user") == 0) {
             auto scaleFactorInput = ParseScaleFactors(FLAGS_sf);
-            if (scaleFactorInput.size() != network.getInputsInfo().size()) {
+            if (numInputArkFiles != scaleFactorInput.size()) {
                 std::string errMessage("Incorrect command line for multiple inputs: "
-                    + std::to_string(scaleFactorInput.size()) +  " scale factors provided for "
-                    + std::to_string(network.getInputsInfo().size()) + " inputs.");
+                    + std::to_string(scaleFactorInput.size()) + " scale factors provided for "
+                    + std::to_string(numInputArkFiles) + " input files.");
                 throw std::logic_error(errMessage);
             }
+
             for (size_t i = 0; i < scaleFactorInput.size(); ++i) {
                 slog::info << "For input " << i << " using scale factor of " << scaleFactorInput[i] << slog::endl;
                 std::string scaleFactorConfigKey = GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_") + std::to_string(i);