even graceful batch 1 handling without duplication

This commit is contained in:
myshevts 2021-12-06 14:57:51 +03:00
parent d328835222
commit 71c7986bcc

View File

@ -580,7 +580,7 @@ InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadN
networkConfig.insert(deviceConfig.begin(), deviceConfig.end());
InferenceEngine::SoExecutableNetworkInternal executableNetworkWithBatch;
while (!executableNetworkWithBatch && (metaDevice.batchForDevice !=1)) {
if (metaDevice.batchForDevice > 1) {
try {
CNNNetwork clonedNetwork(InferenceEngine::cloneNetwork(network));
const InputsDataMap inputInfo = clonedNetwork.getInputsInfo();
@ -612,14 +612,11 @@ InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadN
}
}
} catch (...) {
// reload the network with smaller batch
executableNetworkWithBatch = {nullptr, nullptr};
std::cout << "WA for network failure!!!" << std::endl;
metaDevice.batchForDevice /= 2;
}
}
if (metaDevice.batchForDevice == 1) {
if (!executableNetworkWithoutBatch) {
executableNetworkWithBatch = executableNetworkWithoutBatch;
std::cout << "FALLBACK to using batch1 network!!!" << std::endl;
}