Refactored VPU tests not to use old interfaces (#3888)
* Refactored VPU tests not to use old interfaces * Added except of exceptions * Commented failing part of HDDL tests
This commit is contained in:
parent
05d97fa24a
commit
61ccde700f
@ -37,7 +37,7 @@ TEST_P(InferRequestTests, SetEmptyConfig) {
|
||||
// Create CNNNetwork from ngrpah::Function
|
||||
InferenceEngine::CNNNetwork cnnNet(function);
|
||||
// Load CNNNetwork to target plugins
|
||||
InferenceEngine::IExecutableNetwork::Ptr execNet;
|
||||
InferenceEngine::ExecutableNetwork execNet;
|
||||
std::map<std::string, std::string> config {};
|
||||
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
|
||||
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
|
||||
@ -55,7 +55,7 @@ TEST_P(InferRequestTests, canLoadCorrectNetworkToGetExecutable) {
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
// Create CNNNetwork from ngrpah::Function
|
||||
InferenceEngine::CNNNetwork cnnNet(function);
|
||||
InferenceEngine::IExecutableNetwork::Ptr execNet;
|
||||
InferenceEngine::ExecutableNetwork execNet;
|
||||
ASSERT_NO_THROW(execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration));
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ TEST_P(InferRequestTests, CanCreateTwoExeNetworks) {
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
// Create CNNNetwork from ngrpah::Function
|
||||
InferenceEngine::CNNNetwork cnnNet(function);
|
||||
InferenceEngine::IExecutableNetwork::Ptr execNet;
|
||||
InferenceEngine::ExecutableNetwork execNet;
|
||||
for (auto i = 0; i < 2; i++) {
|
||||
ASSERT_NO_THROW(execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration));
|
||||
ASSERT_NE(nullptr, cnnNet.getFunction());
|
||||
|
@ -21,8 +21,7 @@ void MyriadLoadNetworkTestCase::SetUp() {
|
||||
}
|
||||
|
||||
void MyriadLoadNetworkTestCase::LoadNetwork() {
|
||||
ASSERT_NO_THROW(InferenceEngine::IExecutableNetwork::Ptr exe_network =
|
||||
ie->LoadNetwork(cnnNetwork, "MYRIAD"));
|
||||
ASSERT_NO_THROW(ie->LoadNetwork(cnnNetwork, "MYRIAD"));
|
||||
}
|
||||
|
||||
bool MyriadLoadNetworkTestCase::IsDeviceAvailable(std::string device_name) {
|
||||
|
@ -21,9 +21,7 @@ class MyriadProtocolTests : public testing::Test,
|
||||
public MyriadDevicesInfo {
|
||||
public:
|
||||
// IE variables
|
||||
InferenceEngine::IInferRequest::Ptr request;
|
||||
InferenceEngine::ResponseDesc resp;
|
||||
StatusCode statusCode = StatusCode::GENERAL_ERROR;
|
||||
InferenceEngine::InferRequest request;
|
||||
static std::shared_ptr<InferenceEngine::Core> ie;
|
||||
|
||||
// MVNC variables
|
||||
|
@ -17,18 +17,13 @@ TEST_P(MyriadProtocolTests, CanInferenceWithProtocol) {
|
||||
|
||||
std::map<std::string, std::string> config = getConfigForProtocol(protocol);
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exe_network =
|
||||
InferenceEngine::ExecutableNetwork exe_network =
|
||||
ie->LoadNetwork(network, "MYRIAD", config);
|
||||
|
||||
ASSERT_NO_THROW(statusCode = exe_network->CreateInferRequest(request, &resp));
|
||||
ASSERT_EQ(statusCode, StatusCode::OK) << resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(statusCode = request->Infer(&resp));
|
||||
ASSERT_EQ(statusCode, StatusCode::OK) << resp.msg;
|
||||
ASSERT_NO_THROW(request = exe_network.CreateInferRequest());
|
||||
ASSERT_NO_THROW(request.Infer());
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_P(MyriadProtocolTests, NoErrorsMessagesWhenLoadNetworkSuccessful) {
|
||||
if (protocol != NC_USB) {
|
||||
GTEST_SKIP();
|
||||
@ -42,11 +37,10 @@ TEST_P(MyriadProtocolTests, NoErrorsMessagesWhenLoadNetworkSuccessful) {
|
||||
|
||||
std::map<std::string, std::string> config = {{CONFIG_KEY(LOG_LEVEL), CONFIG_VALUE(LOG_WARNING)}};
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exe_network =
|
||||
InferenceEngine::ExecutableNetwork exe_network =
|
||||
ie->LoadNetwork(network, "MYRIAD", config);
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
|
||||
std::string content(buff);
|
||||
for (int i = MVLOG_WARN; i < MVLOG_LAST; i++) {
|
||||
auto found = content.find(mvLogHeader[i]);
|
||||
|
@ -17,7 +17,7 @@ namespace Regression { namespace Matchers {
|
||||
class ClassificationMatcher : public BaseMatcher {
|
||||
private:
|
||||
size_t checkResultNumber;
|
||||
std::vector<std::shared_ptr<InferenceEngine::IExecutableNetwork>> _executableNetworks;
|
||||
std::vector<InferenceEngine::ExecutableNetwork> _executableNetworks;
|
||||
std::vector <std::vector<Reference::LabelProbability>> _results;
|
||||
ResponseDesc _resp;
|
||||
InferenceEngine::InputsDataMap _inputsInfo;
|
||||
|
@ -14,22 +14,11 @@ public:
|
||||
IECoreAdapter(
|
||||
std::shared_ptr<InferenceEngine::Core> ieCore, std::string deviceName);
|
||||
|
||||
// -----------------------------------------
|
||||
// IInferencePlugin API (deprecated). Begin.
|
||||
// - InferenceEngine::ICNNNetwork is replaced by InferenceEngine::CNNNetwork
|
||||
// -----------------------------------------
|
||||
InferenceEngine::ExecutableNetwork LoadNetwork(const InferenceEngine::CNNNetwork & network,
|
||||
const std::map<std::string, std::string>& config = {});
|
||||
|
||||
InferenceEngine::StatusCode LoadNetwork(
|
||||
InferenceEngine::IExecutableNetwork::Ptr& ret, InferenceEngine::CNNNetwork network,
|
||||
const std::map<std::string, std::string>& config, InferenceEngine::ResponseDesc* resp) noexcept;
|
||||
|
||||
InferenceEngine::StatusCode ImportNetwork(
|
||||
InferenceEngine::IExecutableNetwork::Ptr& ret, const std::string& modelFileName,
|
||||
const std::map<std::string, std::string>& config, InferenceEngine::ResponseDesc* resp) noexcept;
|
||||
|
||||
// -----------------------------------------
|
||||
// IInferencePlugin API (deprecated). End.
|
||||
// -----------------------------------------
|
||||
InferenceEngine::ExecutableNetwork ImportNetwork(const std::string& modelFileName,
|
||||
const std::map<std::string, std::string>& config = {});
|
||||
|
||||
InferenceEngine::ExecutableNetwork ImportNetwork(std::istream& networkModel,
|
||||
const std::map<std::string, std::string>& config = {});
|
||||
|
@ -213,18 +213,14 @@ inline void TopResults(unsigned int n, TBlob<T>& input, std::vector<unsigned>& o
|
||||
|
||||
void ClassificationMatcher::match_n(size_t top, int index) {
|
||||
try {
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
if (_executableNetworks[index]->CreateInferRequest(inferRequest, &_resp) != OK) {
|
||||
THROW_IE_EXCEPTION << "Can not create infer request: " << _resp.msg;
|
||||
}
|
||||
auto inferRequest = _executableNetworks[index].CreateInferRequest();
|
||||
std::string prevImageName = "";
|
||||
|
||||
auto batchSize = config.batchSize;
|
||||
|
||||
if (config.useDynamicBatching) {
|
||||
batchSize = config.dynBatch;
|
||||
InferenceEngine::ResponseDesc resp;
|
||||
inferRequest->SetBatch(batchSize, &resp);
|
||||
inferRequest.SetBatch(batchSize);
|
||||
}
|
||||
|
||||
if (config._paths_to_images.size() % batchSize != 0) {
|
||||
@ -249,25 +245,14 @@ void ClassificationMatcher::match_n(size_t top, int index) {
|
||||
for (int j = 0; j != batchSize; j++) {
|
||||
const auto & imageName = config._paths_to_images[i + j];
|
||||
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
if (inferRequest->GetBlob(_inputsInfo.begin()->first.c_str(), inputBlob, &_resp) != OK) {
|
||||
THROW_IE_EXCEPTION << "Can not get input with name: " << _inputsInfo.begin()->first
|
||||
<< " error message: " << _resp.msg;
|
||||
}
|
||||
auto inputBlob = inferRequest.GetBlob(_inputsInfo.begin()->first.c_str());
|
||||
loadImage(imageName, inputBlob, true, j);
|
||||
}
|
||||
}
|
||||
|
||||
StatusCode status = inferRequest->Infer(&_resp);
|
||||
if (status != OK) {
|
||||
THROW_IE_EXCEPTION << "Can not do infer: " << _resp.msg;
|
||||
}
|
||||
inferRequest.Infer();
|
||||
|
||||
InferenceEngine::Blob::Ptr outputBlobPtr;
|
||||
if (inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), outputBlobPtr, &_resp) != OK) {
|
||||
THROW_IE_EXCEPTION << "Can not get output with name: " << _outputsInfo.begin()->first
|
||||
<< " error message: " << _resp.msg;
|
||||
}
|
||||
auto outputBlobPtr = inferRequest.GetBlob(_outputsInfo.begin()->first.c_str());
|
||||
|
||||
InferenceEngine::TBlob<float>::Ptr outputFP32;
|
||||
if (outputBlobPtr->getTensorDesc().getPrecision() == InferenceEngine::Precision::FP16) {
|
||||
|
@ -12,32 +12,16 @@ using IECorePtr = std::shared_ptr<InferenceEngine::Core>;
|
||||
IECoreAdapter::IECoreAdapter(IECorePtr ieCore, std::string deviceName)
|
||||
: m_ieCore(ieCore), m_deviceName(deviceName) {}
|
||||
|
||||
StatusCode IECoreAdapter::LoadNetwork(
|
||||
IExecutableNetwork::Ptr& ret, CNNNetwork network,
|
||||
const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept {
|
||||
|
||||
try {
|
||||
ret = m_ieCore->LoadNetwork(network, m_deviceName, config);
|
||||
} catch (const std::exception& ex) {
|
||||
return DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();
|
||||
}
|
||||
|
||||
return OK;
|
||||
ExecutableNetwork IECoreAdapter::LoadNetwork(
|
||||
const CNNNetwork & network,
|
||||
const std::map<std::string, std::string>& config) {
|
||||
return m_ieCore->LoadNetwork(network, m_deviceName, config);
|
||||
}
|
||||
|
||||
StatusCode IECoreAdapter::ImportNetwork(
|
||||
IExecutableNetwork::Ptr& ret, const std::string& modelFileName,
|
||||
const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept {
|
||||
|
||||
try {
|
||||
ret = m_ieCore->ImportNetwork(modelFileName, m_deviceName, config);
|
||||
} catch (const NetworkNotRead& ie_ex) {
|
||||
return DescriptionBuffer(NETWORK_NOT_READ, resp) << ie_ex.what();
|
||||
} catch (const std::exception& ex) {
|
||||
return DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();
|
||||
}
|
||||
|
||||
return OK;
|
||||
ExecutableNetwork IECoreAdapter::ImportNetwork(
|
||||
const std::string& modelFileName,
|
||||
const std::map<std::string, std::string>& config) {
|
||||
return m_ieCore->ImportNetwork(modelFileName, m_deviceName, config);
|
||||
}
|
||||
|
||||
ExecutableNetwork IECoreAdapter::ImportNetwork(
|
||||
|
@ -140,33 +140,12 @@ void SegmentationMatcher::match() {
|
||||
executableNetwork = loadedExecutableNetwork;
|
||||
}
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
sts = static_cast<IExecutableNetwork::Ptr&>(executableNetwork)->CreateInferRequest(inferRequest, &dsc);
|
||||
if (sts != InferenceEngine::OK) {
|
||||
THROW_IE_EXCEPTION << "Failed CreateInferRequest with error: " << dsc.msg;
|
||||
}
|
||||
|
||||
sts = inferRequest->SetBlob(inputs.begin()->first.c_str(), input, &dsc);
|
||||
if (sts != InferenceEngine::OK) {
|
||||
THROW_IE_EXCEPTION << "Failed SetBlob with error: " << dsc.msg;
|
||||
}
|
||||
|
||||
sts = inferRequest->SetBlob(outInfo.begin()->first.c_str(), output, &dsc);
|
||||
if (sts != InferenceEngine::OK) {
|
||||
THROW_IE_EXCEPTION << "Failed SetBlob with error: " << dsc.msg;
|
||||
}
|
||||
auto inferRequest = executableNetwork.CreateInferRequest();
|
||||
inferRequest.SetBlob(inputs.begin()->first.c_str(), input);
|
||||
inferRequest.SetBlob(outInfo.begin()->first.c_str(), output);
|
||||
|
||||
// Infer model
|
||||
sts = inferRequest->Infer(&dsc);
|
||||
|
||||
// Check errors
|
||||
if (sts == InferenceEngine::GENERAL_ERROR) {
|
||||
THROW_IE_EXCEPTION << "Scoring failed! Critical error: " << dsc.msg;
|
||||
} else if (sts == InferenceEngine::NOT_IMPLEMENTED) {
|
||||
THROW_IE_EXCEPTION << "Scoring failed! Input data is incorrect and not supported!";
|
||||
} else if (sts == InferenceEngine::NETWORK_NOT_LOADED) {
|
||||
THROW_IE_EXCEPTION << "Scoring failed! " << dsc.msg;
|
||||
}
|
||||
inferRequest.Infer();
|
||||
|
||||
// Convert output data and save it to image
|
||||
outArray = blobToImageOutputArray(output, nullptr, nullptr, &C);
|
||||
|
@ -43,15 +43,12 @@ TEST_P(myriadBlobTests_smoke, CanGetSameBlobsOnSameIR) {
|
||||
const size_t countBlobsToDump = 3;
|
||||
std::vector<std::string> filenames(countBlobsToDump);
|
||||
for (int i = 0; i < countBlobsToDump; i++) {
|
||||
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork,
|
||||
{ {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue } }, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork,
|
||||
{ {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue } }));
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "spltConvConcat" << i << ".blob";
|
||||
filenames[i] = modelFilenameStream.str();
|
||||
ASSERT_NO_THROW(_exeNetwork->Export(modelFilenameStream.str(), nullptr));
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str()));
|
||||
}
|
||||
|
||||
for (int i = 0; i < filenames.size() - 1; i++) {
|
||||
@ -74,8 +71,8 @@ using myriadBlobExportTests_smoke = myriadLayersTests_nightly;
|
||||
|
||||
TEST_F(myriadBlobExportTests_smoke, CanNotDoImportOnNonExistFile)
|
||||
{
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::NETWORK_NOT_READ, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, "I_dont_exist.blob", {}, nullptr));
|
||||
ASSERT_THROW(_vpuPluginPtr->ImportNetwork("I_dont_exist.blob"),
|
||||
InferenceEngine::NetworkNotRead);
|
||||
}
|
||||
|
||||
TEST_F(myriadBlobExportTests_smoke, CanInferImportedNetworkOnExportedBlob)
|
||||
@ -83,17 +80,17 @@ TEST_F(myriadBlobExportTests_smoke, CanInferImportedNetworkOnExportedBlob)
|
||||
auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat();
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, { }, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "SplitConvConcat" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg;
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(inferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str()));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, inferRequest->Infer(&_resp)) << _resp.msg;
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = importedNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
}
|
||||
|
||||
TEST_F(myriadBlobExportTests_smoke, CanGetPerfCountsImportedNetwork)
|
||||
@ -101,20 +98,20 @@ TEST_F(myriadBlobExportTests_smoke, CanGetPerfCountsImportedNetwork)
|
||||
auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat();
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "splitConvConcat" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
std::map<std::string, std::string> config = { {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} };
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg;
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(inferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config));
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = importedNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, inferRequest->Infer(&_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfCounts;
|
||||
ASSERT_EQ(StatusCode::OK, inferRequest->GetPerformanceCounts(perfCounts, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(perfCounts = inferRequest.GetPerformanceCounts());
|
||||
|
||||
ASSERT_NE(0, perfCounts.size());
|
||||
for (const auto &perfInfoElem : perfCounts) {
|
||||
@ -154,10 +151,10 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetCompileOptionPrintsWar
|
||||
auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat();
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "splitConvConcat" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
|
||||
std::map<std::string, std::string> config = { {InferenceEngine::MYRIAD_COPY_OPTIMIZATION, CONFIG_VALUE(YES)},
|
||||
@ -167,8 +164,8 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetCompileOptionPrintsWar
|
||||
{InferenceEngine::MYRIAD_NUMBER_OF_SHAVES, std::to_string(10)},
|
||||
{InferenceEngine::MYRIAD_NUMBER_OF_CMX_SLICES, std::to_string(10)} };
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config));
|
||||
|
||||
std::string content = redirectCoutStream.str();
|
||||
for (auto &&elem : config) {
|
||||
@ -184,10 +181,10 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetRuntimeOptionDoesNotPr
|
||||
auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat();
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "splitConvConcat" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
std::map<std::string, std::string> config = { {CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(YES)},
|
||||
{CONFIG_KEY(LOG_LEVEL), CONFIG_VALUE(LOG_INFO)},
|
||||
@ -198,8 +195,8 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetRuntimeOptionDoesNotPr
|
||||
config.insert({VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)});
|
||||
}
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config));
|
||||
|
||||
std::string content = redirectCoutStream.str();
|
||||
for (auto &&elem : config) {
|
||||
@ -220,62 +217,62 @@ TEST_F(myriadBlobExportAccuracyDifferentCountInAndOutTests_smoke, IsResultOfImpo
|
||||
auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat();
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr originalExeNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(originalExeNetworkPtr, _cnnNetwork, { }, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork originalExeNetwork;
|
||||
ASSERT_NO_THROW(originalExeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
|
||||
ConstInputsDataMap originalInputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->GetInputsInfo(originalInputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(originalInputsInfo = originalExeNetwork.GetInputsInfo());
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr orignalInferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->CreateInferRequest(orignalInferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::InferRequest orignalInferRequest;
|
||||
ASSERT_NO_THROW(orignalInferRequest = originalExeNetwork.CreateInferRequest());
|
||||
|
||||
std::vector<Blob::Ptr> inputBlobs(originalInputsInfo.size());
|
||||
auto inputBlobsIt = inputBlobs.begin();
|
||||
for (const auto &inputInfo : originalInputsInfo) {
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(inputInfo.first.c_str(), *inputBlobsIt, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(*inputBlobsIt = orignalInferRequest.GetBlob(inputInfo.first.c_str()));
|
||||
GenRandomData(*inputBlobsIt);
|
||||
inputBlobsIt++;
|
||||
}
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->Infer(&_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(orignalInferRequest.Infer());
|
||||
|
||||
ConstOutputsDataMap orignalOutputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->GetOutputsInfo(orignalOutputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(orignalOutputsInfo = originalExeNetwork.GetOutputsInfo());
|
||||
|
||||
std::vector<Blob::Ptr> originalOutputBlobs(orignalOutputsInfo.size());
|
||||
auto outputBlobsIt = originalOutputBlobs.begin();
|
||||
for (const auto &outputInfo: orignalOutputsInfo) {
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(outputInfo.first.c_str(), *outputBlobsIt, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(*outputBlobsIt = orignalInferRequest.GetBlob(outputInfo.first.c_str()));
|
||||
outputBlobsIt++;
|
||||
}
|
||||
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "exportedModel" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(originalExeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg;
|
||||
InferenceEngine::IInferRequest::Ptr importedInferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(importedInferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str()));
|
||||
InferenceEngine::InferRequest importedInferRequest;
|
||||
ASSERT_NO_THROW(importedInferRequest = importedNetwork.CreateInferRequest());
|
||||
|
||||
ConstInputsDataMap importedInputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetInputsInfo(importedInputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedInputsInfo = importedNetwork.GetInputsInfo());
|
||||
|
||||
inputBlobsIt = inputBlobs.begin();
|
||||
for (const auto &inputInfo : importedInputsInfo) {
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->SetBlob(inputInfo.first.c_str(), *inputBlobsIt, &_resp)) << &_resp.msg;
|
||||
ASSERT_NO_THROW(importedInferRequest.SetBlob(inputInfo.first.c_str(), *inputBlobsIt));
|
||||
inputBlobsIt++;
|
||||
}
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->Infer(&_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedInferRequest.Infer());
|
||||
|
||||
ConstOutputsDataMap importedOutputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetOutputsInfo(importedOutputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedOutputsInfo = importedNetwork.GetOutputsInfo());
|
||||
|
||||
outputBlobsIt = originalOutputBlobs.begin();
|
||||
for (const auto &outputInfo : importedOutputsInfo) {
|
||||
Blob::Ptr importedOutputBlobPtr;
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->GetBlob(outputInfo.first.c_str(), importedOutputBlobPtr, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedOutputBlobPtr = importedInferRequest.GetBlob(outputInfo.first.c_str()));
|
||||
|
||||
CompareCommonAbsolute(importedOutputBlobPtr, *outputBlobsIt, 0.f);
|
||||
outputBlobsIt++;
|
||||
@ -306,46 +303,46 @@ TEST_P(myriadBlobExportAccuracyDifferentPrecisionOfInAndOutTests_smoke, IsResult
|
||||
auto outputInfo = outputsInfo.begin();
|
||||
ASSERT_NO_THROW(outputInfo->second->setPrecision(outputPrecision));
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr originalExeNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(originalExeNetworkPtr, network, { }, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork originalExeNetwork;
|
||||
ASSERT_NO_THROW(originalExeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr orignalInferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->CreateInferRequest(orignalInferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::InferRequest orignalInferRequest;
|
||||
ASSERT_NO_THROW(orignalInferRequest = originalExeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputBlobPtr;
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(inputInfo->first.c_str(), inputBlobPtr, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlobPtr = orignalInferRequest.GetBlob(inputInfo->first.c_str()));
|
||||
GenRandomData(inputBlobPtr);
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->Infer(&_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(orignalInferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlobPtr;
|
||||
ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(outputInfo->first.c_str(), outputBlobPtr, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(outputBlobPtr = orignalInferRequest.GetBlob(outputInfo->first.c_str()));
|
||||
|
||||
std::stringstream modelFilenameStream;
|
||||
modelFilenameStream << "exportedModel" << ".blob";
|
||||
ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->Export(modelFilenameStream.str(), &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(originalExeNetwork.Export(modelFilenameStream.str()));
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr;
|
||||
ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg;
|
||||
InferenceEngine::IInferRequest::Ptr importedInferRequest;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(importedInferRequest, &_resp)) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str()));
|
||||
InferenceEngine::InferRequest importedInferRequest;
|
||||
ASSERT_NO_THROW(importedInferRequest = importedNetwork.CreateInferRequest());
|
||||
|
||||
ConstInputsDataMap importedInputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetInputsInfo(importedInputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedInputsInfo = importedNetwork.GetInputsInfo());
|
||||
ASSERT_EQ(importedInputsInfo.size(), 1);
|
||||
auto importedInputInfo = importedInputsInfo.begin();
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->SetBlob(importedInputInfo->first.c_str(), inputBlobPtr, &_resp)) << &_resp.msg;
|
||||
ASSERT_NO_THROW(importedInferRequest.SetBlob(importedInputInfo->first.c_str(), inputBlobPtr));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->Infer(&_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedInferRequest.Infer());
|
||||
|
||||
ConstOutputsDataMap importedOutputsInfo;
|
||||
ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetOutputsInfo(importedOutputsInfo, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedOutputsInfo = importedNetwork.GetOutputsInfo());
|
||||
ASSERT_EQ(importedOutputsInfo.size(), 1);
|
||||
auto importedOutputInfo = importedOutputsInfo.begin();
|
||||
|
||||
Blob::Ptr importedOutputBlobPtr;
|
||||
ASSERT_EQ(StatusCode::OK, importedInferRequest->GetBlob(importedOutputInfo->first.c_str(), importedOutputBlobPtr, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(importedOutputBlobPtr = importedInferRequest.GetBlob(importedOutputInfo->first.c_str()));
|
||||
|
||||
CompareCommonAbsolute(importedOutputBlobPtr, outputBlobPtr, 0.f);
|
||||
}
|
||||
@ -396,6 +393,7 @@ TEST_F(myriadExtraTests_smoke, ThereIsNoSegfaultOnZeroConvolutionWeights) {
|
||||
,{ "dilation-x", std::to_string(dilation_factor.x) }
|
||||
,{ "dilation-y", std::to_string(dilation_factor.y) }
|
||||
};
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(makeSingleLayerNetwork(LayerInitParams("Convolution")
|
||||
.params(layer_params)
|
||||
.weights(num_weights)
|
||||
|
@ -160,37 +160,27 @@ TEST_F(myriadLayersTestsConcat_smoke, ConcatAfterNormalize) {
|
||||
outputsInfo["copy2"]->setLayout(Layout::NHWC);
|
||||
|
||||
// Load network
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
|
||||
// Create InferRequest
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
// Generate input blob
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("input"));
|
||||
GenRandomData(inputBlob);
|
||||
|
||||
// Get output blob
|
||||
InferenceEngine::Blob::Ptr output;
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("concat", output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(output = inferRequest.GetBlob("concat"));
|
||||
|
||||
// Get blobs which are input to Concat
|
||||
InferenceEngine::Blob::Ptr norm1;
|
||||
InferenceEngine::Blob::Ptr norm2;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("copy1", norm1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("copy2", norm2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
InferenceEngine::Blob::Ptr norm1, norm2;
|
||||
ASSERT_NO_THROW(norm1 = inferRequest.GetBlob("copy1"));
|
||||
ASSERT_NO_THROW(norm2 = inferRequest.GetBlob("copy2"));
|
||||
|
||||
InferenceEngine::BlobMap normMap;
|
||||
normMap["normalize1"] = norm1;
|
||||
normMap["normalize2"] = norm2;
|
||||
|
@ -266,29 +266,20 @@ protected:
|
||||
// Infer
|
||||
//
|
||||
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputValuesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("input"));
|
||||
|
||||
void* inputValuesBlobDataPtr = inputValuesBlob->buffer();
|
||||
std::memcpy(inputValuesBlobDataPtr, inputBlobDataPtr, inputNum * sizeof(ie_fp16));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputValuesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("convolution", outputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("convolution"));
|
||||
|
||||
//
|
||||
// Check result
|
||||
//
|
||||
|
@ -172,8 +172,6 @@ TEST_P(myriadConvolution1x1LayerTests_smoke, Convolution1x1) {
|
||||
|
||||
InferenceEngine::TBlob<uint8_t>::Ptr weights_ptr = InferenceEngine::TBlob<uint8_t>::Ptr(GenWeights(num_weights));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(model, weights_ptr);
|
||||
|
||||
@ -185,49 +183,44 @@ TEST_P(myriadConvolution1x1LayerTests_smoke, Convolution1x1) {
|
||||
_outputsInfo["conv1x1"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["conv1x1"]->setLayout(layout);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig.custom_config},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}},
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob("data"));
|
||||
GenRandomData(data);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
{
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
// TODO: fix CVS-47174
|
||||
if (0)
|
||||
{
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
}
|
||||
}
|
||||
printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d].\n", IB, IC, IH, IW, OB, OC, OH, OW);
|
||||
printf("[----------] isHardware: %s; isHWC: %d.\n", HWConfigValue.c_str(), isHWC);
|
||||
}
|
||||
printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d].\n", IB, IC, IH, IW, OB, OC, OH, OW);
|
||||
printf("[----------] isHardware: %s; isHWC: %d.\n", HWConfigValue.c_str(), isHWC);
|
||||
}
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("conv1x1", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("conv1x1"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW));
|
||||
_refBlob->allocate();
|
||||
|
||||
|
@ -189,8 +189,6 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) {
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(model, weights_ptr);
|
||||
|
||||
StatusCode st;
|
||||
|
||||
_inputsInfo = network.getInputsInfo();
|
||||
_inputsInfo["data"]->setPrecision(Precision::FP16);
|
||||
@ -200,19 +198,14 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) {
|
||||
_outputsInfo["conv3x3"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["conv3x3"]->setLayout(NCHW);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig.custom_config},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}},
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob("data"));
|
||||
GenRandomData(data);
|
||||
|
||||
//padding with zeros 1 row(top/bottom), 1 column(left/right) input tensor
|
||||
@ -233,33 +226,33 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
// TODO: fix CVS-47174
|
||||
if (0)
|
||||
{
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
}
|
||||
}
|
||||
printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d]; stride: %d.\n", IB, IC, IH, IW, OB, OC, OH, OW, stride_xy);
|
||||
printf("[----------] isHardware: %s.\n", HWConfigValue.c_str());
|
||||
}
|
||||
printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d]; stride: %d.\n", IB, IC, IH, IW, OB, OC, OH, OW, stride_xy);
|
||||
printf("[----------] isHardware: %s.\n", HWConfigValue.c_str());
|
||||
}
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("conv3x3", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("conv3x3"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW));
|
||||
_refBlob->allocate();
|
||||
|
@ -704,8 +704,6 @@ TEST_F(myriadLayersTests_nightly, DISABLED_tests125) {
|
||||
InferenceEngine::TBlob<uint8_t>::Ptr weights(GenWeights(1697280 / sizeof(ie_fp16)));
|
||||
constWeightsRange(weights->data().as<uint16_t *>(), 1697280 / sizeof(ie_fp16));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(MODEL_RFCNN, weights);
|
||||
|
||||
@ -716,26 +714,21 @@ TEST_F(myriadLayersTests_nightly, DISABLED_tests125) {
|
||||
outputsInfo[outName1]->setPrecision(Precision::FP16);
|
||||
outputsInfo[outName2]->setPrecision(Precision::FP16);
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input", input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input = inferRequest.GetBlob("input"));
|
||||
genTestData(input);
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
|
||||
Blob::Ptr out1;
|
||||
Blob::Ptr out2;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(outName1.c_str(), out1, &_resp));
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(outName2.c_str(), out2, &_resp));
|
||||
Blob::Ptr out1, out2;
|
||||
ASSERT_NO_THROW(out1 = inferRequest.GetBlob(outName1.c_str()));
|
||||
ASSERT_NO_THROW(out2 = inferRequest.GetBlob(outName2.c_str()));
|
||||
};
|
||||
|
||||
// This tests checks that conv3x3s1 case doesn't corrupt its input.
|
||||
@ -874,8 +867,6 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) {
|
||||
const ie_fp16 *weights = weightsBlob->readOnly().as<const ie_fp16 *>();
|
||||
const ie_fp16 *bias = weights + num_weights;
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model, weightsBlob));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -887,15 +878,12 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) {
|
||||
_outputsInfo["conv1_out"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["conv2_out"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input = _inferRequest.GetBlob("input"));
|
||||
{
|
||||
ie_fp16 *dst = input->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < input->size(); ++i) {
|
||||
@ -904,16 +892,13 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr conv1;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("conv1_out", conv1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(conv1 = _inferRequest.GetBlob("conv1_out"));
|
||||
|
||||
Blob::Ptr conv2;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("conv2_out", conv2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(conv2 = _inferRequest.GetBlob("conv2_out"));
|
||||
|
||||
{
|
||||
SCOPED_TRACE("CompareCommonAbsolute with itself");
|
||||
|
@ -909,8 +909,6 @@ TEST_P(myriadLayersTestsQuantizeBinarize_smoke, Quantize_Binarization) {
|
||||
model.replace( model.find("@output_low_size@"), sizeof("@output_low_size@") -1, std::to_string(output_low_size));
|
||||
model.replace( model.find("@output_high_size@"), sizeof("@output_high_size@") -1, std::to_string(output_high_size));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(model, InferenceEngine::Blob::CPtr());
|
||||
|
||||
@ -931,74 +929,64 @@ TEST_P(myriadLayersTestsQuantizeBinarize_smoke, Quantize_Binarization) {
|
||||
_inputsInfo["output_high"]->setLayout(NCHW);
|
||||
_outputsInfo["Quantize"]->setLayout(NCHW);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
{{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig }}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig }}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob("data"));
|
||||
GenRandomData(data);
|
||||
|
||||
Blob::Ptr input_low;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input_low", input_low, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input_low = _inferRequest.GetBlob("input_low"));
|
||||
GenRandomData(input_low);
|
||||
|
||||
Blob::Ptr input_high;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input_high", input_high, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input_high = _inferRequest.GetBlob("input_high"));
|
||||
Blob::Ptr output_low;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("output_low", output_low, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(output_low = _inferRequest.GetBlob("output_low"));
|
||||
Blob::Ptr output_high;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("output_high", output_high, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
if(levels == 2){
|
||||
ASSERT_NO_THROW(output_high = _inferRequest.GetBlob("output_high"));
|
||||
|
||||
if (levels == 2) {
|
||||
memcpy((uint8_t*)input_high->buffer(), (uint8_t*)input_low->buffer(), input_high->byteSize());
|
||||
for(int i = 0; i < (output_low->byteSize() / output_low->element_size()); ++i){
|
||||
*((ie_fp16*)output_low->buffer() + i) = switch_out ? PrecisionUtils::f32tof16(1.0f) : PrecisionUtils::f32tof16(-1.0f);
|
||||
*((ie_fp16*)output_high->buffer() + i) = switch_out ? PrecisionUtils::f32tof16(-1.0f) : PrecisionUtils::f32tof16(1.0f);
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
GenRandomData(input_high);
|
||||
GenRandomData(output_low);
|
||||
GenRandomData(output_high);
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
{
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
// TODO: fix CVS-47174
|
||||
if (0)
|
||||
{
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair2) -> bool {
|
||||
return pair1.second.execution_index < pair2.second.execution_index;
|
||||
});
|
||||
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("\x1B[32m[----------]\x1B[0m Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
unsigned currentIndex = 0;
|
||||
for (auto it = perfVec.begin(); it != perfVec.end(); ++it) {
|
||||
std::string layerName = it->first;
|
||||
InferenceEngine::InferenceEngineProfileInfo info = it->second;
|
||||
if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) {
|
||||
printf("\x1B[32m[----------]\x1B[0m Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("Quantize", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("Quantize"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW));
|
||||
_refBlob->allocate();
|
||||
|
||||
|
@ -863,8 +863,6 @@ public:
|
||||
gen_confidence[i] = static_cast<float>(std::rand()) / RAND_MAX;
|
||||
}
|
||||
|
||||
StatusCode st;
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(PRIOR_BOX_CLUSTERED_MODEL, InferenceEngine::Blob::CPtr());
|
||||
|
||||
@ -877,20 +875,13 @@ public:
|
||||
outputsInfo["data2_copy"]->setPrecision(Precision::FP16);
|
||||
outputsInfo["priorboxclustered_copy"]->setPrecision(Precision::FP16);
|
||||
|
||||
IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest->GetBlob("priorboxclustered_copy", priorOutput, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(priorOutput = inferRequest.GetBlob("priorboxclustered_copy"));
|
||||
}
|
||||
|
||||
TBlob<float>::Ptr refOutput;
|
||||
@ -998,8 +989,6 @@ public:
|
||||
TEST_F(myriadDetectionOutputTests_smoke, NoConst) {
|
||||
ASSERT_NO_FATAL_FAILURE(PrepareInput());
|
||||
ASSERT_NO_FATAL_FAILURE(CalcRefOutput(false));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto network = ie.ReadNetwork(DETECTION_OUTPUT_MODEL, InferenceEngine::Blob::CPtr());
|
||||
@ -1015,18 +1004,14 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) {
|
||||
outputsInfo["data2_copy"]->setPrecision(Precision::FP16);
|
||||
outputsInfo["detection_out"]->setPrecision(Precision::FP16);
|
||||
|
||||
IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr locations;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations"));
|
||||
{
|
||||
ie_fp16 *dst = locations->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_LOC; ++i) {
|
||||
@ -1035,8 +1020,7 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) {
|
||||
}
|
||||
|
||||
Blob::Ptr confidence;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence"));
|
||||
{
|
||||
ie_fp16 *dst = confidence->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_CONF; ++i) {
|
||||
@ -1044,11 +1028,8 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out"));
|
||||
|
||||
CheckResults();
|
||||
}
|
||||
@ -1057,8 +1038,6 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) {
|
||||
ASSERT_NO_FATAL_FAILURE(PrepareInput());
|
||||
ASSERT_NO_FATAL_FAILURE(CalcRefOutput(true));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
TBlob<uint8_t>::Ptr weights(new TBlob<uint8_t>({Precision::U8, {priorOutput->byteSize()}, Layout::C}, priorOutput->buffer().as<uint8_t *>()));
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
@ -1071,18 +1050,14 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) {
|
||||
auto outputsInfo = network.getOutputsInfo();
|
||||
outputsInfo["detection_out"]->setPrecision(Precision::FP16);
|
||||
|
||||
IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr locations;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations"));
|
||||
{
|
||||
ie_fp16 *dst = locations->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_LOC; ++i) {
|
||||
@ -1091,8 +1066,7 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) {
|
||||
}
|
||||
|
||||
Blob::Ptr confidence;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence"));
|
||||
{
|
||||
ie_fp16 *dst = confidence->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_CONF; ++i) {
|
||||
@ -1100,11 +1074,8 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out"));
|
||||
|
||||
CheckResults();
|
||||
}
|
||||
@ -1113,8 +1084,6 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) {
|
||||
ASSERT_NO_FATAL_FAILURE(PrepareInput());
|
||||
ASSERT_NO_FATAL_FAILURE(CalcRefOutput(false));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
TBlob<uint8_t>::Ptr weights(new TBlob<uint8_t>({Precision::U8, {priorOutput->byteSize()}, Layout::C}, priorOutput->buffer().as<uint8_t *>()));
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
@ -1127,18 +1096,14 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) {
|
||||
auto outputsInfo = network.getOutputsInfo();
|
||||
outputsInfo["detection_out"]->setPrecision(Precision::FP16);
|
||||
|
||||
IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
|
||||
IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr locations;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations"));
|
||||
{
|
||||
ie_fp16 *dst = locations->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_LOC; ++i) {
|
||||
@ -1147,8 +1112,7 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) {
|
||||
}
|
||||
|
||||
Blob::Ptr confidence;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence"));
|
||||
{
|
||||
ie_fp16 *dst = confidence->buffer().as<ie_fp16 *>();
|
||||
for (int i = 0; i < NUM_CONF; ++i) {
|
||||
@ -1156,11 +1120,8 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out"));
|
||||
|
||||
CheckResults();
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ INSTANTIATE_TEST_CASE_P(accuracy, myriadTestsEltwiseMean_smoke,
|
||||
);
|
||||
|
||||
TEST_F(myriadLayersTestsEltwiseBase, EltwiseWithSameInputs) {
|
||||
StatusCode st;
|
||||
|
||||
const std::string model = R"V0G0N(
|
||||
<net batch="1" name="VNect: Test" version="2">
|
||||
@ -253,28 +252,20 @@ TEST_F(myriadLayersTestsEltwiseBase, EltwiseWithSameInputs) {
|
||||
networkOutputs.begin()->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
InferenceEngine::ExecutableNetwork exeNetwork;
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetwork;
|
||||
std::map<std::string, std::string> networkConfig = {{InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}};
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network, networkConfig));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob(networkInputs.begin()->first.c_str()));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(networkInputs.begin()->first.c_str(), inputBlob, &_resp));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
GenRandomData(inputBlob);
|
||||
|
||||
InferenceEngine::Blob::Ptr output;
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(networkOutputs.begin()->first.c_str(), output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(output = inferRequest.GetBlob(networkOutputs.begin()->first.c_str()));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>({Precision::FP16, output->getTensorDesc().getDims(), output->getTensorDesc().getLayout()});
|
||||
_refBlob->allocate();
|
||||
@ -490,24 +481,16 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithReLU) {
|
||||
auto outputInfo = _outputsInfo["last"];
|
||||
outputInfo->setPrecision(Precision::FP16);
|
||||
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{ {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE},
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} },
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }));
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto sumAndReLULayerIt = perfMap.find("sum + sum_relu");
|
||||
ASSERT_TRUE(sumAndReLULayerIt != perfMap.end());
|
||||
@ -722,24 +705,16 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithLeakyReLU) {
|
||||
auto outputInfo = _outputsInfo["last"];
|
||||
outputInfo->setPrecision(Precision::FP16);
|
||||
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{ {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE},
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} },
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }));
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto sumAndReLULayerIt = perfMap.find("sum + sum_leaky_relu");
|
||||
ASSERT_TRUE(sumAndReLULayerIt != perfMap.end());
|
||||
@ -954,25 +929,17 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithClamp) {
|
||||
auto outputInfo = _outputsInfo["last"];
|
||||
outputInfo->setPrecision(Precision::FP16);
|
||||
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(
|
||||
_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(
|
||||
network,
|
||||
{ {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE},
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} },
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }));
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto sumAndReLULayerIt = perfMap.find("sum + sum_clamp");
|
||||
ASSERT_TRUE(sumAndReLULayerIt != perfMap.end());
|
||||
|
@ -153,232 +153,223 @@ class ExpDetectionOutputTest: public myriadLayerTestBaseWithParam<ExpDetectionOu
|
||||
{
|
||||
protected:
|
||||
void testExpDetectionOutput()
|
||||
{
|
||||
_config[InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH] = CONFIG_VALUE(NO);
|
||||
{
|
||||
_config[InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH] = CONFIG_VALUE(NO);
|
||||
|
||||
const auto testParams = GetParam();
|
||||
const auto sizeParams = std::get<0>(testParams);
|
||||
const auto layerParams = std::get<1>(testParams);
|
||||
const auto testParams = GetParam();
|
||||
const auto sizeParams = std::get<0>(testParams);
|
||||
const auto layerParams = std::get<1>(testParams);
|
||||
|
||||
const auto blobDims = calcBlobDims(sizeParams);
|
||||
const auto blobDims = calcBlobDims(sizeParams);
|
||||
|
||||
const auto model = getModel(blobDims, layerParams);
|
||||
const auto model = getModel(blobDims, layerParams);
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
const auto& network = _cnnNetwork;
|
||||
|
||||
_inputsInfo = network.getInputsInfo();
|
||||
_inputsInfo["detectionOutput_inputBoxes"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputBoxes"]->setLayout(defaultLayout(blobDims[InputBoxes].size()));
|
||||
_inputsInfo["detectionOutput_inputDeltas"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputDeltas"]->setLayout(defaultLayout(blobDims[InputDeltas].size()));
|
||||
_inputsInfo["detectionOutput_inputScores"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputScores"]->setLayout(defaultLayout(blobDims[InputScores].size()));
|
||||
_inputsInfo["detectionOutput_inputIMinfo"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputIMinfo"]->setLayout(defaultLayout(blobDims[InputIMinfo].size()));
|
||||
_inputsInfo = network.getInputsInfo();
|
||||
_inputsInfo["detectionOutput_inputBoxes"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputBoxes"]->setLayout(defaultLayout(blobDims[InputBoxes].size()));
|
||||
_inputsInfo["detectionOutput_inputDeltas"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputDeltas"]->setLayout(defaultLayout(blobDims[InputDeltas].size()));
|
||||
_inputsInfo["detectionOutput_inputScores"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputScores"]->setLayout(defaultLayout(blobDims[InputScores].size()));
|
||||
_inputsInfo["detectionOutput_inputIMinfo"]->setPrecision(dataPrecision);
|
||||
_inputsInfo["detectionOutput_inputIMinfo"]->setLayout(defaultLayout(blobDims[InputIMinfo].size()));
|
||||
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["expDetectionOutput.0"]->setPrecision(dataPrecision);
|
||||
_outputsInfo["expDetectionOutput.0"]->setLayout(defaultLayout(blobDims[OutputBoxes].size()));
|
||||
_outputsInfo["expDetectionOutput.1"]->setPrecision(classPrecision);
|
||||
_outputsInfo["expDetectionOutput.1"]->setLayout(defaultLayout(blobDims[OutputClasses].size()));
|
||||
_outputsInfo["expDetectionOutput.2"]->setPrecision(dataPrecision);
|
||||
_outputsInfo["expDetectionOutput.2"]->setLayout(defaultLayout(blobDims[OutputScores].size()));
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["expDetectionOutput.0"]->setPrecision(dataPrecision);
|
||||
_outputsInfo["expDetectionOutput.0"]->setLayout(defaultLayout(blobDims[OutputBoxes].size()));
|
||||
_outputsInfo["expDetectionOutput.1"]->setPrecision(classPrecision);
|
||||
_outputsInfo["expDetectionOutput.1"]->setLayout(defaultLayout(blobDims[OutputClasses].size()));
|
||||
_outputsInfo["expDetectionOutput.2"]->setPrecision(dataPrecision);
|
||||
_outputsInfo["expDetectionOutput.2"]->setLayout(defaultLayout(blobDims[OutputScores].size()));
|
||||
|
||||
StatusCode st = OK;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputBoxesBlob;
|
||||
ASSERT_NO_THROW(inputBoxesBlob = _inferRequest.GetBlob("detectionOutput_inputBoxes"));
|
||||
|
||||
Blob::Ptr inputDeltasBlob;
|
||||
ASSERT_NO_THROW(inputDeltasBlob = _inferRequest.GetBlob("detectionOutput_inputDeltas"));
|
||||
|
||||
Blob::Ptr inputScoresBlob;
|
||||
ASSERT_NO_THROW(inputScoresBlob = _inferRequest.GetBlob("detectionOutput_inputScores"));
|
||||
|
||||
Blob::Ptr inputIMinfoBlob;
|
||||
ASSERT_NO_THROW(inputIMinfoBlob = _inferRequest.GetBlob("detectionOutput_inputIMinfo"));
|
||||
|
||||
generateData(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, sizeParams, layerParams);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBoxesBlob;
|
||||
ASSERT_NO_THROW(outputBoxesBlob = _inferRequest.GetBlob("expDetectionOutput.0"));
|
||||
Blob::Ptr refBoxesBlob = make_shared_blob<ie_fp16>(outputBoxesBlob->getTensorDesc());
|
||||
refBoxesBlob->allocate();
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
Blob::Ptr outputClassesBlob;
|
||||
ASSERT_NO_THROW(outputClassesBlob = _inferRequest.GetBlob("expDetectionOutput.1"));
|
||||
Blob::Ptr refClassesBlob = make_shared_blob<int32_t>(outputClassesBlob->getTensorDesc());
|
||||
refClassesBlob->allocate();
|
||||
|
||||
Blob::Ptr inputBoxesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputBoxes", inputBoxesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
Blob::Ptr outputScoresBlob;
|
||||
ASSERT_NO_THROW(outputScoresBlob = _inferRequest.GetBlob("expDetectionOutput.2"));
|
||||
Blob::Ptr refScoresBlob = make_shared_blob<ie_fp16>(outputScoresBlob->getTensorDesc());
|
||||
refScoresBlob->allocate();
|
||||
|
||||
Blob::Ptr inputDeltasBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputDeltas", inputDeltasBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ref_expDetectionOutput(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob,
|
||||
refBoxesBlob, refClassesBlob, refScoresBlob,
|
||||
sizeParams.numRois, sizeParams.numClasses, sizeParams.maxDetections, layerParams);
|
||||
|
||||
Blob::Ptr inputScoresBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputScores", inputScoresBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
CompareCommonAbsolute(refBoxesBlob, outputBoxesBlob, 0.0f);
|
||||
CompareCommonExact(refClassesBlob, outputClassesBlob);
|
||||
CompareCommonAbsolute(refScoresBlob, outputScoresBlob, 0.0f);
|
||||
}
|
||||
|
||||
Blob::Ptr inputIMinfoBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputIMinfo", inputIMinfoBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
generateData(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, sizeParams, layerParams);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
Blob::Ptr outputBoxesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.0", outputBoxesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
Blob::Ptr refBoxesBlob = make_shared_blob<ie_fp16>(outputBoxesBlob->getTensorDesc());
|
||||
refBoxesBlob->allocate();
|
||||
|
||||
Blob::Ptr outputClassesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.1", outputClassesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
Blob::Ptr refClassesBlob = make_shared_blob<int32_t>(outputClassesBlob->getTensorDesc());
|
||||
refClassesBlob->allocate();
|
||||
|
||||
Blob::Ptr outputScoresBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.2", outputScoresBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
Blob::Ptr refScoresBlob = make_shared_blob<ie_fp16>(outputScoresBlob->getTensorDesc());
|
||||
refScoresBlob->allocate();
|
||||
|
||||
ref_expDetectionOutput(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob,
|
||||
refBoxesBlob, refClassesBlob, refScoresBlob,
|
||||
sizeParams.numRois, sizeParams.numClasses, sizeParams.maxDetections, layerParams);
|
||||
|
||||
CompareCommonAbsolute(refBoxesBlob, outputBoxesBlob, 0.0f);
|
||||
CompareCommonExact(refClassesBlob, outputClassesBlob);
|
||||
CompareCommonAbsolute(refScoresBlob, outputScoresBlob, 0.0f);
|
||||
}
|
||||
static std::string getModel(const BlobDimsList& blobDims, const ExpDetectionOutputParams& layerParams)
|
||||
{
|
||||
std::string model = R"V0G0N(
|
||||
<net name="testExpDetectionOutput" version="5">
|
||||
<layers>
|
||||
<layer id="0" name="detectionOutput_inputBoxes" type="Input">
|
||||
{
|
||||
std::string model = R"V0G0N(
|
||||
<net name="testExpDetectionOutput" version="5">
|
||||
<layers>
|
||||
<layer id="0" name="detectionOutput_inputBoxes" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_BOXES_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="1" name="detectionOutput_inputDeltas" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_DELTAS_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="2" name="detectionOutput_inputScores" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_SCORES_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="3" name="detectionOutput_inputIMinfo" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_IM_INFO_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="4" name="expDetectionOutput" type="ExperimentalDetectronDetectionOutput">
|
||||
<data __LAYER_PARAMS__/>
|
||||
<input>
|
||||
<port id="0">__INPUT_BOXES_DIMS__</port>
|
||||
<port id="1">__INPUT_DELTAS_DIMS__</port>
|
||||
<port id="2">__INPUT_SCORES_DIMS__</port>
|
||||
<port id="3">__INPUT_IM_INFO_DIMS__</port>
|
||||
</input>
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_BOXES_DIMS__</port>
|
||||
<port id="4" precision="__DATA_PRECISION__">__OUTPUT_BOXES_DIMS__</port>
|
||||
<port id="5" precision="__CLASS_PRECISION__">__OUTPUT_CLASSES_DIMS__</port>
|
||||
<port id="6" precision="__DATA_PRECISION__">__OUTPUT_SCORES_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="1" name="detectionOutput_inputDeltas" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_DELTAS_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="2" name="detectionOutput_inputScores" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_SCORES_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="3" name="detectionOutput_inputIMinfo" type="Input">
|
||||
<output>
|
||||
<port id="0" precision="__DATA_PRECISION__">__INPUT_IM_INFO_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
<layer id="4" name="expDetectionOutput" type="ExperimentalDetectronDetectionOutput">
|
||||
<data __LAYER_PARAMS__/>
|
||||
<input>
|
||||
<port id="0">__INPUT_BOXES_DIMS__</port>
|
||||
<port id="1">__INPUT_DELTAS_DIMS__</port>
|
||||
<port id="2">__INPUT_SCORES_DIMS__</port>
|
||||
<port id="3">__INPUT_IM_INFO_DIMS__</port>
|
||||
</input>
|
||||
<output>
|
||||
<port id="4" precision="__DATA_PRECISION__">__OUTPUT_BOXES_DIMS__</port>
|
||||
<port id="5" precision="__CLASS_PRECISION__">__OUTPUT_CLASSES_DIMS__</port>
|
||||
<port id="6" precision="__DATA_PRECISION__">__OUTPUT_SCORES_DIMS__</port>
|
||||
</output>
|
||||
</layer>
|
||||
</layers>
|
||||
<edges>
|
||||
<edge from-layer="0" from-port="0" to-layer="4" to-port="0"/>
|
||||
<edge from-layer="1" from-port="0" to-layer="4" to-port="1"/>
|
||||
<edge from-layer="2" from-port="0" to-layer="4" to-port="2"/>
|
||||
<edge from-layer="3" from-port="0" to-layer="4" to-port="3"/>
|
||||
</edges>
|
||||
</net>
|
||||
)V0G0N";
|
||||
</layers>
|
||||
<edges>
|
||||
<edge from-layer="0" from-port="0" to-layer="4" to-port="0"/>
|
||||
<edge from-layer="1" from-port="0" to-layer="4" to-port="1"/>
|
||||
<edge from-layer="2" from-port="0" to-layer="4" to-port="2"/>
|
||||
<edge from-layer="3" from-port="0" to-layer="4" to-port="3"/>
|
||||
</edges>
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
const auto inputBoxesDimsStr = dimsToString(blobDims[InputBoxes]);
|
||||
const auto inputDeltasDimsStr = dimsToString(blobDims[InputDeltas]);
|
||||
const auto inputScoresDimsStr = dimsToString(blobDims[InputScores]);
|
||||
const auto inputIMinfoDimsStr = dimsToString(blobDims[InputIMinfo]);
|
||||
const auto inputBoxesDimsStr = dimsToString(blobDims[InputBoxes]);
|
||||
const auto inputDeltasDimsStr = dimsToString(blobDims[InputDeltas]);
|
||||
const auto inputScoresDimsStr = dimsToString(blobDims[InputScores]);
|
||||
const auto inputIMinfoDimsStr = dimsToString(blobDims[InputIMinfo]);
|
||||
|
||||
const auto outputBoxesDimsStr = dimsToString(blobDims[OutputBoxes]);
|
||||
const auto outputClassesDimsStr = dimsToString(blobDims[OutputClasses]);
|
||||
const auto outputScoresDimsStr = dimsToString(blobDims[OutputScores]);
|
||||
const auto outputBoxesDimsStr = dimsToString(blobDims[OutputBoxes]);
|
||||
const auto outputClassesDimsStr = dimsToString(blobDims[OutputClasses]);
|
||||
const auto outputScoresDimsStr = dimsToString(blobDims[OutputScores]);
|
||||
|
||||
const auto layerParamsStr = layerParamsToString(layerParams);
|
||||
const auto layerParamsStr = layerParamsToString(layerParams);
|
||||
|
||||
REPLACE_WITH_STR(model, "__DATA_PRECISION__", dataPrecision.name());
|
||||
REPLACE_WITH_STR(model, "__CLASS_PRECISION__", classPrecision.name());
|
||||
REPLACE_WITH_STR(model, "__DATA_PRECISION__", dataPrecision.name());
|
||||
REPLACE_WITH_STR(model, "__CLASS_PRECISION__", classPrecision.name());
|
||||
|
||||
REPLACE_WITH_STR(model, "__INPUT_BOXES_DIMS__", inputBoxesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_DELTAS_DIMS__", inputDeltasDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_SCORES_DIMS__", inputScoresDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_IM_INFO_DIMS__", inputIMinfoDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_BOXES_DIMS__", inputBoxesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_DELTAS_DIMS__", inputDeltasDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_SCORES_DIMS__", inputScoresDimsStr);
|
||||
REPLACE_WITH_STR(model, "__INPUT_IM_INFO_DIMS__", inputIMinfoDimsStr);
|
||||
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_BOXES_DIMS__", outputBoxesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_CLASSES_DIMS__", outputClassesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_SCORES_DIMS__", outputScoresDimsStr);
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_BOXES_DIMS__", outputBoxesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_CLASSES_DIMS__", outputClassesDimsStr);
|
||||
REPLACE_WITH_STR(model, "__OUTPUT_SCORES_DIMS__", outputScoresDimsStr);
|
||||
|
||||
REPLACE_WITH_STR(model, "__LAYER_PARAMS__", layerParamsStr);
|
||||
REPLACE_WITH_STR(model, "__LAYER_PARAMS__", layerParamsStr);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
static std::string layerParamsToString(const ExpDetectionOutputParams& layerParams)
|
||||
{
|
||||
std::string str;
|
||||
|
||||
str += "deltas_weights=\"";
|
||||
const char* sep = "";
|
||||
for (auto& w : layerParams.deltas_weights)
|
||||
{
|
||||
std::string str;
|
||||
|
||||
str += "deltas_weights=\"";
|
||||
const char* sep = "";
|
||||
for (auto& w : layerParams.deltas_weights)
|
||||
{
|
||||
str += sep + std::to_string(w);
|
||||
sep = ",";
|
||||
}
|
||||
str += "\"";
|
||||
|
||||
str += " max_delta_log_wh=\"" + std::to_string(layerParams.max_delta_log_wh) + "\"";
|
||||
str += " nms_threshold=\"" + std::to_string(layerParams.nms_threshold) + "\"";
|
||||
str += " score_threshold=\"" + std::to_string(layerParams.score_threshold) + "\"";
|
||||
str += " max_detections_per_image=\"" + std::to_string(layerParams.max_detections_per_image) + "\"";
|
||||
str += " num_classes=\"" + std::to_string(layerParams.num_classes) + "\"";
|
||||
str += " post_nms_count=\"" + std::to_string(layerParams.post_nms_count) + "\"";
|
||||
str += " class_agnostic_box_regression=\"" + std::to_string(layerParams.class_agnostic_box_regression) + "\"";
|
||||
|
||||
return str;
|
||||
str += sep + std::to_string(w);
|
||||
sep = ",";
|
||||
}
|
||||
str += "\"";
|
||||
|
||||
str += " max_delta_log_wh=\"" + std::to_string(layerParams.max_delta_log_wh) + "\"";
|
||||
str += " nms_threshold=\"" + std::to_string(layerParams.nms_threshold) + "\"";
|
||||
str += " score_threshold=\"" + std::to_string(layerParams.score_threshold) + "\"";
|
||||
str += " max_detections_per_image=\"" + std::to_string(layerParams.max_detections_per_image) + "\"";
|
||||
str += " num_classes=\"" + std::to_string(layerParams.num_classes) + "\"";
|
||||
str += " post_nms_count=\"" + std::to_string(layerParams.post_nms_count) + "\"";
|
||||
str += " class_agnostic_box_regression=\"" + std::to_string(layerParams.class_agnostic_box_regression) + "\"";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static std::string dimsToString(const SizeVector& dims)
|
||||
{
|
||||
std::string str;
|
||||
for (auto& d : dims)
|
||||
str += "<dim>" + std::to_string(d) + "</dim>";
|
||||
return str;
|
||||
}
|
||||
{
|
||||
std::string str;
|
||||
for (auto& d : dims)
|
||||
str += "<dim>" + std::to_string(d) + "</dim>";
|
||||
return str;
|
||||
}
|
||||
|
||||
static BlobDimsList calcBlobDims(const SizeParams& sizeParams)
|
||||
{
|
||||
const size_t numRois = sizeParams.numRois;
|
||||
const size_t numClasses = sizeParams.numClasses;
|
||||
const size_t maxDetections = sizeParams.maxDetections;
|
||||
{
|
||||
const size_t numRois = sizeParams.numRois;
|
||||
const size_t numClasses = sizeParams.numClasses;
|
||||
const size_t maxDetections = sizeParams.maxDetections;
|
||||
|
||||
BlobDimsList list(NumBlobs);
|
||||
BlobDimsList list(NumBlobs);
|
||||
|
||||
list[InputBoxes] = SizeVector({numRois, 4});
|
||||
list[InputDeltas] = SizeVector({numRois, numClasses * 4});
|
||||
list[InputScores] = SizeVector({numRois, numClasses});
|
||||
list[InputIMinfo] = SizeVector({1, 3});
|
||||
list[InputBoxes] = SizeVector({numRois, 4});
|
||||
list[InputDeltas] = SizeVector({numRois, numClasses * 4});
|
||||
list[InputScores] = SizeVector({numRois, numClasses});
|
||||
list[InputIMinfo] = SizeVector({1, 3});
|
||||
|
||||
list[OutputBoxes] = SizeVector({maxDetections, 4});
|
||||
list[OutputClasses] = SizeVector({maxDetections});
|
||||
list[OutputScores] = SizeVector({maxDetections});
|
||||
list[OutputBoxes] = SizeVector({maxDetections, 4});
|
||||
list[OutputClasses] = SizeVector({maxDetections});
|
||||
list[OutputScores] = SizeVector({maxDetections});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
static Layout defaultLayout(int ndims)
|
||||
{
|
||||
switch (ndims)
|
||||
{
|
||||
switch (ndims)
|
||||
{
|
||||
case 5: return NCDHW;
|
||||
case 4: return NCHW;
|
||||
case 3: return CHW;
|
||||
case 2: return NC;
|
||||
case 1: return C;
|
||||
}
|
||||
return ANY;
|
||||
case 5: return NCDHW;
|
||||
case 4: return NCHW;
|
||||
case 3: return CHW;
|
||||
case 2: return NC;
|
||||
case 1: return C;
|
||||
}
|
||||
return ANY;
|
||||
}
|
||||
};
|
||||
|
||||
class myriadTestsExpDetectionOutput_smoke: public ExpDetectionOutputTest
|
||||
|
@ -50,25 +50,19 @@ TEST_F(myriadLayersTests_nightly, LSTMCellSequenceNet) {
|
||||
(++++networkInputsFull.begin())->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
networkOutputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetworkFull;
|
||||
InferenceEngine::ExecutableNetwork exeNetworkFull;
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetworkFull, full_network, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetworkFull->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(exeNetworkFull = _vpuPluginPtr->LoadNetwork(full_network, networkConfig));
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetworkFull.CreateInferRequest());
|
||||
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("RNNInput"));
|
||||
|
||||
InferenceEngine::Blob::Ptr inputBlobHidden;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput_Hidden", inputBlobHidden, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlobHidden = inferRequest.GetBlob("RNNInput_Hidden"));
|
||||
InferenceEngine::Blob::Ptr inputBlobCellState;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput_CellState", inputBlobCellState, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlobCellState = inferRequest.GetBlob("RNNInput_CellState"));
|
||||
|
||||
/* input tensors generating */
|
||||
ie_fp16 *src_data_cell_state = static_cast<ie_fp16*>(inputBlobCellState->buffer());
|
||||
@ -156,18 +150,14 @@ TEST_F(myriadLayersTests_nightly, LSTMCellSequenceNet) {
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput_Hidden", inputBlobHidden, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput_CellState", inputBlobCellState, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput_Hidden", inputBlobHidden));
|
||||
ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput_CellState", inputBlobCellState));
|
||||
ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput", inputBlob));
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
|
||||
InferenceEngine::Blob::Ptr output;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNOutput", output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(output = inferRequest.GetBlob("RNNOutput"));
|
||||
|
||||
CompareCommonAbsolute(output, refOut0, ERROR_BOUND);
|
||||
}
|
||||
|
@ -54,8 +54,6 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input)
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -66,14 +64,11 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input)
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["mvn"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
{{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(YES)}}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(YES)}}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
auto tensorDesc = TensorDesc(Precision::FP16, _inputsInfo["data"]->getTensorDesc().getDims(), Layout::NCHW);
|
||||
auto inputNCHW = make_shared_blob<ie_fp16>(tensorDesc);
|
||||
ASSERT_NO_THROW(inputNCHW->allocate());
|
||||
@ -86,14 +81,9 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input)
|
||||
|
||||
ASSERT_NO_THROW(GenRandomData(inputNCHW));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNCHW, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("mvn", outputNCHW, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNCHW));
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("mvn", outputNCHW));
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(refMVN(inputNCHW, output_ref, 1, 1, 9.999999717180685e-10, true));
|
||||
|
||||
|
@ -220,29 +220,20 @@ protected:
|
||||
// Infer
|
||||
//
|
||||
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputValuesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("input"));
|
||||
|
||||
void* inputValuesBlobDataPtr = inputValuesBlob->buffer();
|
||||
std::memcpy(inputValuesBlobDataPtr, inputBlobDataPtr, inputNum * sizeof(ie_fp16));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputValuesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("pooling", outputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("pooling"));
|
||||
|
||||
//
|
||||
// Check result
|
||||
//
|
||||
|
@ -211,8 +211,6 @@ TEST_F(myriadLayersTests_nightly, PriorBoxClustered) {
|
||||
SetSeed(DEFAULT_SEED_VALUE + 6);
|
||||
PriorBoxClusteredParams params;
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -226,31 +224,24 @@ TEST_F(myriadLayersTests_nightly, PriorBoxClustered) {
|
||||
_outputsInfo["data2_copy"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["priorboxclustered_copy"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data1;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1"));
|
||||
|
||||
Blob::Ptr data2;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2"));
|
||||
|
||||
GenRandomData(data1);
|
||||
GenRandomData(data2);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("priorboxclustered_copy", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("priorboxclustered_copy"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>({Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY});
|
||||
_refBlob->allocate();
|
||||
|
||||
|
@ -289,8 +289,6 @@ public:
|
||||
const PriorBoxParams& params, Precision outPrec = Precision::FP16) {
|
||||
SetSeed(DEFAULT_SEED_VALUE + 5);
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -304,31 +302,23 @@ public:
|
||||
_outputsInfo["data2_copy"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo[outputName]->setPrecision(outPrec);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data1;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1"));
|
||||
|
||||
Blob::Ptr data2;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2"));
|
||||
|
||||
GenRandomData(data1);
|
||||
GenRandomData(data2);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob(outputName.c_str(), outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob(outputName.c_str()));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY));
|
||||
_refBlob->allocate();
|
||||
|
||||
@ -1296,8 +1286,6 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat)
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -1321,24 +1309,19 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat)
|
||||
_outputsInfo["conv9_2_copy"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["mbox_priorbox_copy"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
// TODO: uncomment this code when GraphTransformer will be updated
|
||||
// to optimize out extra copies in case of PriorBox+Concat pair.
|
||||
#if 0
|
||||
{
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
int count = 0;
|
||||
for (auto p : perfMap) {
|
||||
auto layerName = p.first;
|
||||
@ -1353,9 +1336,8 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat)
|
||||
#endif
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("mbox_priorbox_copy", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("mbox_priorbox_copy"));
|
||||
|
||||
auto conv4_3_norm_mbox_priorbox = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, {1, 2, 23104}, Layout::ANY));
|
||||
{
|
||||
conv4_3_norm_mbox_priorbox->allocate();
|
||||
@ -1836,8 +1818,6 @@ TEST_F(myriadLayersPriorBoxTests_smoke, TwoPriorBoxLayersWithUnusedInput)
|
||||
|
||||
SetSeed(DEFAULT_SEED_VALUE + 5);
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -1852,34 +1832,26 @@ TEST_F(myriadLayersPriorBoxTests_smoke, TwoPriorBoxLayersWithUnusedInput)
|
||||
_outputsInfo["priorbox1"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["priorbox2"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr data1;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1"));
|
||||
|
||||
Blob::Ptr data2;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2"));
|
||||
|
||||
GenRandomData(data1);
|
||||
GenRandomData(data2);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlob1;
|
||||
Blob::Ptr outputBlob2;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("priorbox1", outputBlob1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("priorbox2", outputBlob2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob1 = _inferRequest.GetBlob("priorbox1"));
|
||||
ASSERT_NO_THROW(outputBlob2 = _inferRequest.GetBlob("priorbox2"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>(TensorDesc(Precision::FP16, outputBlob1->getTensorDesc().getDims(), ANY));
|
||||
_refBlob->allocate();
|
||||
|
||||
|
@ -37,8 +37,6 @@ protected:
|
||||
void InferProposalLayer() {
|
||||
SetSeed(DEFAULT_SEED_VALUE + 13);
|
||||
|
||||
StatusCode st;
|
||||
|
||||
REPLACE_WITH_STR(model, "__PRECISION__", precision.name());
|
||||
|
||||
REPLACE_WITH_STR(model, "__CLIP_BEFORE_NMS__", clip_before_nms);
|
||||
@ -60,25 +58,18 @@ protected:
|
||||
_outputsInfo["proposal"]->setPrecision(precision);
|
||||
_outputsInfo["proposal"]->setLayout(NC);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr rpn_cls_prob_reshape;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("rpn_cls_prob_reshape", rpn_cls_prob_reshape, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(rpn_cls_prob_reshape = _inferRequest.GetBlob("rpn_cls_prob_reshape"));
|
||||
|
||||
Blob::Ptr rpn_bbox_pred;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("rpn_bbox_pred", rpn_bbox_pred, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(rpn_bbox_pred = _inferRequest.GetBlob("rpn_bbox_pred"));
|
||||
|
||||
Blob::Ptr img_info;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("im_info", img_info, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(img_info = _inferRequest.GetBlob("im_info"));
|
||||
|
||||
// for rpn_cls_prob_reshape
|
||||
std::string inputTensor1Binary = TestDataHelpers::get_data_path() + cls_prob_file;
|
||||
ASSERT_TRUE(fromBinaryFile(inputTensor1Binary, rpn_cls_prob_reshape));
|
||||
@ -101,11 +92,8 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest->GetBlob("proposal", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("proposal"));
|
||||
}
|
||||
|
||||
void compareOutputSampleToRef(std::vector<float> & gt_values, const float error_threshold) {
|
||||
|
@ -149,12 +149,8 @@ public:
|
||||
outputInfo.second->setLayout(NCHW);
|
||||
}
|
||||
|
||||
InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp));
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg;
|
||||
ASSERT_EQ((int)InferenceEngine::StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_inferRequest, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(_inputsInfo = _cnnNetwork.getInputsInfo());
|
||||
ASSERT_NO_THROW(_outputsInfo = _cnnNetwork.getOutputsInfo());
|
||||
@ -166,23 +162,18 @@ public:
|
||||
InferenceEngine::Layout layout = inputInfo.second->getTensorDesc().getLayout();
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(inputInfo.first.c_str(), data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob(inputInfo.first.c_str()));
|
||||
|
||||
if (inputInfo.first == _inputsInfo.begin()->first)
|
||||
{
|
||||
GenRandomData(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
genROIs(data, params, num_rois);
|
||||
}
|
||||
|
||||
_inputMap[inputInfo.first] = data;
|
||||
}
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob(_outputsInfo.begin()->first.c_str()));
|
||||
_outputMap[_outputsInfo.begin()->first] = data;
|
||||
}
|
||||
|
||||
|
@ -416,23 +416,16 @@ protected:
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["reduce"]->setPrecision(dataPrecision);
|
||||
_outputsInfo["reduce"]->setLayout(vpu::deviceLayout(TensorDesc::getLayoutByDims(outputDims), layoutPreference));
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("reduce_input", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("reduce_input"));
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("reduce", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("reduce"));
|
||||
|
||||
Blob::Ptr refBlob = nullptr;
|
||||
float compareThreshold = 0.0f;
|
||||
if (dataPrecision == Precision::FP16) {
|
||||
@ -443,9 +436,8 @@ protected:
|
||||
auto generateData = opIt->second.generateData;
|
||||
generateData(inputBlob);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
refBlob = make_shared_blob<ie_fp16>(outputBlob->getTensorDesc());
|
||||
refBlob->allocate();
|
||||
ref_reduce(inputBlob, axesBlob, refBlob, keepDims, layoutPreference, reduceOp);
|
||||
@ -457,9 +449,8 @@ protected:
|
||||
auto generateData = opIt->second.generateData;
|
||||
generateData(inputBlob);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
refBlob = make_shared_blob<int32_t>(outputBlob->getTensorDesc());
|
||||
refBlob->allocate();
|
||||
ref_reduce(inputBlob, axesBlob, refBlob, keepDims, layoutPreference, reduceOp);
|
||||
@ -468,25 +459,11 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
class myriadTestsReduceAnd_smoke: public ReduceTest<REDUCE_AND>
|
||||
{
|
||||
};
|
||||
|
||||
class myriadTestsReduceMin_smoke: public ReduceTest<REDUCE_MIN>
|
||||
{
|
||||
};
|
||||
|
||||
class myriadTestsReduceMax_smoke: public ReduceTest<REDUCE_MAX>
|
||||
{
|
||||
};
|
||||
|
||||
class myriadTestsReduceSum_smoke: public ReduceTest<REDUCE_SUM>
|
||||
{
|
||||
};
|
||||
|
||||
class myriadTestsReduceMean_smoke: public ReduceTest<REDUCE_MEAN>
|
||||
{
|
||||
};
|
||||
using myriadTestsReduceAnd_smoke = ReduceTest<REDUCE_AND>;
|
||||
using myriadTestsReduceMin_smoke = ReduceTest<REDUCE_MIN>;
|
||||
using myriadTestsReduceMax_smoke = ReduceTest<REDUCE_MAX>;
|
||||
using myriadTestsReduceSum_smoke = ReduceTest<REDUCE_SUM>;
|
||||
using myriadTestsReduceMean_smoke = ReduceTest<REDUCE_MEAN>;
|
||||
|
||||
// Tests are disabled due to hang: #-28315
|
||||
|
||||
|
@ -162,7 +162,6 @@ TEST_F(myriadLayersTests_nightly, graphTransformerNotThrowExceptionIfConvOutputI
|
||||
)V0G0N";
|
||||
|
||||
TBlob<uint8_t>::Ptr weightsBlob(GenWeights(120));
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model, weightsBlob));
|
||||
|
||||
@ -175,9 +174,8 @@ TEST_F(myriadLayersTests_nightly, graphTransformerNotThrowExceptionIfConvOutputI
|
||||
_outputsInfo["conv1/relu"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["deconv"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
}
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
}
|
||||
|
||||
TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) {
|
||||
const std::string model = R"V0G0N(
|
||||
@ -274,8 +272,6 @@ TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) {
|
||||
|
||||
TBlob<uint8_t>::Ptr weights(GenWeights(num_weights + num_bias));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model, weights));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -287,6 +283,5 @@ TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) {
|
||||
_outputsInfo["relu"]->setPrecision(Precision::FP16);
|
||||
_outputsInfo["power"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(st, StatusCode::OK);
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {}));
|
||||
}
|
||||
|
@ -14,8 +14,6 @@ const std::string relu_param = "negative_slope";
|
||||
class myriadLayersTestsReLUMergeWithBias_smoke : public myriadLayersTests_nightly {
|
||||
public:
|
||||
void RunTest(const std::string& model, size_t num_weights, size_t num_bias) {
|
||||
StatusCode st;
|
||||
|
||||
TBlob<uint8_t>::Ptr weights(GenWeights(num_weights + num_bias));
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model, weights));
|
||||
@ -28,23 +26,17 @@ public:
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["relu"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{ {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} },
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
{
|
||||
auto reluAndBiasLayerIt = perfMap.find("relu+Bias");
|
||||
ASSERT_TRUE(reluAndBiasLayerIt != perfMap.end());
|
||||
|
@ -8,36 +8,29 @@
|
||||
TEST_F(myriadEliminateReshapeTests_smoke, SplitConvConcat) {
|
||||
ASSERT_NO_THROW(_cnnNetwork = InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat()));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork,
|
||||
{
|
||||
{
|
||||
InferenceEngine::MYRIAD_PERF_REPORT_MODE,
|
||||
InferenceEngine::MYRIAD_PER_STAGE
|
||||
},
|
||||
{
|
||||
InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION,
|
||||
CONFIG_VALUE(NO)
|
||||
},
|
||||
{
|
||||
CONFIG_KEY(PERF_COUNT),
|
||||
CONFIG_VALUE(YES)
|
||||
}
|
||||
},
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork,
|
||||
{
|
||||
{
|
||||
InferenceEngine::MYRIAD_PERF_REPORT_MODE,
|
||||
InferenceEngine::MYRIAD_PER_STAGE
|
||||
},
|
||||
{
|
||||
InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION,
|
||||
CONFIG_VALUE(NO)
|
||||
},
|
||||
{
|
||||
CONFIG_KEY(PERF_COUNT),
|
||||
CONFIG_VALUE(YES)
|
||||
}
|
||||
}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto layerInfo = perfMap["MobilenetV1/Logits/SpatialSqueeze"];
|
||||
ASSERT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status);
|
||||
}
|
||||
@ -192,8 +185,6 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) {
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -206,38 +197,30 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) {
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["reshape_copy"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{ {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)},
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} }, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} }));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input1;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input1", input1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input1 = _inferRequest.GetBlob("input1"));
|
||||
GenRandomData(input1);
|
||||
|
||||
Blob::Ptr input2;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input2", input2, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input2 = _inferRequest.GetBlob("input2"));
|
||||
GenRandomData(input2);
|
||||
|
||||
Blob::Ptr input3;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input3", input3, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input3 = _inferRequest.GetBlob("input3"));
|
||||
GenRandomData(input3);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr output;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("reshape_copy", output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(output = _inferRequest.GetBlob("reshape_copy"));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>({Precision::FP16, output->getTensorDesc().getDims(), Layout::ANY});
|
||||
_refBlob->allocate();
|
||||
{
|
||||
@ -259,9 +242,8 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) {
|
||||
CompareCommonAbsolute(output, _refBlob, 0);
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto layerInfo = perfMap["reshape"];
|
||||
EXPECT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status);
|
||||
}
|
||||
|
@ -208,8 +208,6 @@ TEST_P(myriadLayersTestsReshapeBeforeFC_smoke, OptimizeReshapeIfItIsPlacedBefore
|
||||
}
|
||||
|
||||
std::string outputName = "fc6";
|
||||
StatusCode st = InferenceEngine::OK;
|
||||
InferenceEngine::ResponseDesc resp;
|
||||
TBlob<uint8_t>::Ptr weights(GenWeights(9280 / sizeof(ie_fp16)));
|
||||
|
||||
Core ie;
|
||||
@ -221,27 +219,21 @@ TEST_P(myriadLayersTestsReshapeBeforeFC_smoke, OptimizeReshapeIfItIsPlacedBefore
|
||||
auto outputsInfo = network.getOutputsInfo();
|
||||
outputsInfo[outputName]->setPrecision(Precision::FP16);
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network,
|
||||
InferenceEngine::ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{ {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE},
|
||||
{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue},
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}, &resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
{CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input", input, &resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << resp.msg;
|
||||
ASSERT_NO_THROW(input = inferRequest.GetBlob("input"));
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetPerformanceCounts(perfMap, &resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << resp.msg;
|
||||
ASSERT_NO_THROW(perfMap = inferRequest.GetPerformanceCounts());
|
||||
|
||||
auto layerInfo = perfMap["flatten_0"];
|
||||
EXPECT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status);
|
||||
|
@ -670,7 +670,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void PrepareInputAndReference(const std::string& model_prior_network, const std::string& output_layer, StatusCode& st)
|
||||
void PrepareInputAndReference(const std::string& model_prior_network, const std::string& output_layer)
|
||||
{
|
||||
SetSeed(DEFAULT_SEED_VALUE);
|
||||
|
||||
@ -692,22 +692,17 @@ public:
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
networkConfig["VPU_HW_STAGES_OPTIMIZATION"] = "NO";
|
||||
|
||||
IExecutableNetwork::Ptr exeNetwork;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network_part, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ExecutableNetwork exeNetwork;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network_part, networkConfig));
|
||||
|
||||
IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input0;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input0", input0, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input0 = inferRequest.GetBlob("input0"));
|
||||
|
||||
Blob::Ptr input1;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input1", input1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input1 = inferRequest.GetBlob("input1"));
|
||||
|
||||
// Allocate buffer
|
||||
input0_share = make_shared_blob<ie_fp16>({Precision::FP16, input0->getTensorDesc().getDims(), ANY});
|
||||
@ -729,14 +724,11 @@ public:
|
||||
std::copy(input0_share_data, input0_share_data + input0_share->size(), input0_data);
|
||||
std::copy(input1_share_data, input1_share_data + input1_share->size(), input1_data);
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(output_layer.c_str(), prior_network_output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(prior_network_output = inferRequest.GetBlob(output_layer.c_str()));
|
||||
}
|
||||
|
||||
void RunNetwork(const std::string& model, const std::string& output_layer, StatusCode& st)
|
||||
void RunNetwork(const std::string& model, const std::string& output_layer)
|
||||
{
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
@ -754,23 +746,16 @@ public:
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
networkConfig["VPU_HW_STAGES_OPTIMIZATION"] = "NO";
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, networkConfig));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr input0;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input0", input0, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input0 = _inferRequest.GetBlob("input0"));
|
||||
|
||||
Blob::Ptr input1;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input1", input1, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(input1 = _inferRequest.GetBlob("input1"));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(output_layer.c_str(), outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob(output_layer.c_str()));
|
||||
|
||||
_refBlob = make_shared_blob<ie_fp16>({Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY});
|
||||
_refBlob->allocate();
|
||||
@ -786,8 +771,7 @@ public:
|
||||
std::copy(input0_share_data, input0_share_data + input0_share->size(), input0_data);
|
||||
std::copy(input1_share_data, input1_share_data + input1_share->size(), input1_data);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
}
|
||||
|
||||
Blob::Ptr input0_share;
|
||||
@ -798,15 +782,11 @@ public:
|
||||
|
||||
TEST_F(myriadLayersRfcnTests_smoke, ReshapeRfcn)
|
||||
{
|
||||
StatusCode st = GENERAL_ERROR;
|
||||
|
||||
std::string prior_network_output_layer = "cls_prob";
|
||||
std::string test_network_output_layer = "cls_prob_reshape";
|
||||
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_softmax, prior_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed";
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_reshape, test_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed";
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_softmax, prior_network_output_layer));
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_reshape, test_network_output_layer));
|
||||
|
||||
ASSERT_EQ(outputBlob->size(), prior_network_output->size());
|
||||
CompareCommonAbsolute(outputBlob, prior_network_output, 0.0f);
|
||||
@ -814,15 +794,11 @@ TEST_F(myriadLayersRfcnTests_smoke, ReshapeRfcn)
|
||||
|
||||
TEST_F(myriadLayersRfcnTests_smoke, SoftmaxRfcn)
|
||||
{
|
||||
StatusCode st = GENERAL_ERROR;
|
||||
|
||||
std::string prior_network_output_layer = "ave_cls_score_rois";
|
||||
std::string test_network_output_layer = "cls_prob";
|
||||
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_pooling, prior_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed";
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_softmax, test_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed";
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_pooling, prior_network_output_layer));
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_softmax, test_network_output_layer));
|
||||
|
||||
int param_axis = 1;
|
||||
ref_soft_max(prior_network_output, _refBlob, param_axis);
|
||||
@ -832,15 +808,11 @@ TEST_F(myriadLayersRfcnTests_smoke, SoftmaxRfcn)
|
||||
|
||||
TEST_F(myriadLayersRfcnTests_smoke, GlobalAvgPooling7x7Rfcn)
|
||||
{
|
||||
StatusCode st = GENERAL_ERROR;
|
||||
|
||||
std::string prior_network_output_layer = "PSROIPooling";
|
||||
std::string test_network_output_layer = "ave_cls_score_rois";
|
||||
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_psroipooling, prior_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed";
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_pooling, test_network_output_layer, st));
|
||||
ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed";
|
||||
ASSERT_NO_THROW(PrepareInputAndReference(model_to_psroipooling, prior_network_output_layer));
|
||||
ASSERT_NO_THROW(RunNetwork(model_to_pooling, test_network_output_layer));
|
||||
|
||||
refGlobalAvgPooling7x7Rfcn(prior_network_output, _refBlob);
|
||||
|
||||
|
@ -189,36 +189,26 @@ TEST_P(myriadLayersTestsROIAlign_smoke, ROIAlign) {
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["roi_align"]->setPrecision(Precision::FP16);
|
||||
|
||||
StatusCode st = OK;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr roisBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("boxes", roisBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(roisBlob = _inferRequest.GetBlob("boxes"));
|
||||
genROIs(roisBlob, test_params, num_rois);
|
||||
|
||||
Blob::Ptr featureMapBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("feature_map", featureMapBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(featureMapBlob = _inferRequest.GetBlob("feature_map"));
|
||||
GenRandomData(featureMapBlob);
|
||||
|
||||
Blob::Ptr batchIndicesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("batch_indices", batchIndicesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(batchIndicesBlob = _inferRequest.GetBlob("batch_indices"));
|
||||
genBatchIndices(batchIndicesBlob, num_rois, num_batches);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("roi_align", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("roi_align"));
|
||||
|
||||
Blob::Ptr refOutputBlob = make_shared_blob<float>({Precision::FP32,
|
||||
outputBlob->getTensorDesc().getDims(),
|
||||
outputBlob->getTensorDesc().getLayout()});
|
||||
|
@ -223,12 +223,8 @@ public:
|
||||
outputInfo.second->setLayout(NCHW);
|
||||
}
|
||||
|
||||
InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp));
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg;
|
||||
ASSERT_EQ((int) InferenceEngine::StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_inferRequest, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, {}));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(_inputsInfo = _cnnNetwork.getInputsInfo());
|
||||
ASSERT_NO_THROW(_outputsInfo = _cnnNetwork.getOutputsInfo());
|
||||
@ -237,25 +233,20 @@ public:
|
||||
InferenceEngine::Layout layout = inpt.second->getTensorDesc().getLayout();
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(inpt.first.c_str(), data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob(inpt.first.c_str()));
|
||||
|
||||
SetSeed(3);
|
||||
|
||||
if (inpt.first == _inputsInfo.begin()->first)
|
||||
{
|
||||
GenRandomData(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
genROIs(data, params, num_rois, method);
|
||||
}
|
||||
|
||||
_inputMap[inpt.first] = data;
|
||||
}
|
||||
|
||||
Blob::Ptr data;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), data, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(data = _inferRequest.GetBlob(_outputsInfo.begin()->first.c_str()));
|
||||
_outputMap[_outputsInfo.begin()->first] = data;
|
||||
}
|
||||
};
|
||||
|
@ -124,35 +124,24 @@ protected:
|
||||
// Create infer request and get its blobs pointers
|
||||
//
|
||||
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("input"));
|
||||
|
||||
Blob::Ptr indicesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("indices", indicesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(indicesBlob = _inferRequest.GetBlob("indices"));
|
||||
|
||||
Blob::Ptr updatesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("updates", updatesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(updatesBlob = _inferRequest.GetBlob("updates"));
|
||||
|
||||
Blob::Ptr axisBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("axis", axisBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(axisBlob = _inferRequest.GetBlob("axis"));
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("scatter", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("scatter"));
|
||||
|
||||
Blob::Ptr referenceBlob;
|
||||
if (dataType == "I32") {
|
||||
referenceBlob = make_shared_blob<int32_t>(outputBlob->getTensorDesc());
|
||||
@ -202,9 +191,8 @@ protected:
|
||||
outputBlob->getTensorDesc().setLayout(vpu::deviceLayout(outputLayout, layoutPreference));
|
||||
referenceBlob->getTensorDesc().setLayout(vpu::deviceLayout(outputLayout, layoutPreference));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
//
|
||||
// Check result
|
||||
//
|
||||
|
@ -151,54 +151,42 @@ protected:
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["scatter_update"]->setPrecision(Precision::FP16);
|
||||
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("input"));
|
||||
|
||||
void* inputBlobData = inputBlob->buffer();
|
||||
ASSERT_NE(inputBlobData, nullptr);
|
||||
std::copy(inputData.cbegin(), inputData.cend(), reinterpret_cast<ie_fp16*>(inputBlobData));
|
||||
|
||||
Blob::Ptr indicesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("indices", indicesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(indicesBlob = _inferRequest.GetBlob("indices"));
|
||||
|
||||
void* indicesBlobData = indicesBlob->buffer();
|
||||
ASSERT_NE(indicesBlobData, nullptr);
|
||||
std::copy(indicesData.cbegin(), indicesData.cend(), reinterpret_cast<int32_t*>(indicesBlobData));
|
||||
|
||||
Blob::Ptr updatesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("updates", updatesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(updatesBlob = _inferRequest.GetBlob("updates"));
|
||||
|
||||
void* updatesBlobData = updatesBlob->buffer();
|
||||
ASSERT_NE(updatesBlobData, nullptr);
|
||||
std::copy(updatesData.cbegin(), updatesData.cend(), reinterpret_cast<ie_fp16*>(updatesBlobData));
|
||||
|
||||
Blob::Ptr axisBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("axis", axisBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(axisBlob = _inferRequest.GetBlob("axis"));
|
||||
|
||||
void* axisBlobData = axisBlob->buffer();
|
||||
ASSERT_NE(axisBlobData, nullptr);
|
||||
std::copy(axisData.cbegin(), axisData.cend(), reinterpret_cast<int32_t*>(axisBlobData));
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("scatter_update", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("scatter_update"));
|
||||
|
||||
const void* outputBlobDataPtr = outputBlob->cbuffer();
|
||||
const ie_fp16* outputBlobData = reinterpret_cast<const ie_fp16*>(outputBlobDataPtr);
|
||||
ASSERT_NE(outputBlobData, nullptr);
|
||||
|
@ -239,7 +239,6 @@ TEST_P(myriadLayersTestsStridedSlice_smoke, TestsStridedSlice) {
|
||||
outputsInfo["strided_slice"]->setPrecision(Precision::FP16);
|
||||
|
||||
// Load network.
|
||||
StatusCode st = GENERAL_ERROR;
|
||||
|
||||
std::map<std::string, std::string> config = {
|
||||
{ InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO) }
|
||||
@ -248,30 +247,22 @@ TEST_P(myriadLayersTestsStridedSlice_smoke, TestsStridedSlice) {
|
||||
config.insert({ InferenceEngine::MYRIAD_DISABLE_REORDER, CONFIG_VALUE(YES) });
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(
|
||||
_exeNetwork, network, config,
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, config));
|
||||
|
||||
// Create InferRequest.
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
// Input Data.
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("input", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("input"));
|
||||
GenRandomData(inputBlob);
|
||||
|
||||
// Infer & get output blob.
|
||||
InferenceEngine::Blob::Ptr outputBlob;
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob("strided_slice", outputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(outputBlob = inferRequest.GetBlob("strided_slice"));
|
||||
|
||||
// Output Reference.
|
||||
Blob::Ptr refBlob = InferenceEngine::make_shared_blob<ie_fp16>(outputBlob->getTensorDesc());
|
||||
refBlob->allocate();
|
||||
|
@ -76,32 +76,22 @@ protected:
|
||||
_outputsInfo["topk.1"]->setLayout(defaultLayout(outputDims.size()));
|
||||
}
|
||||
|
||||
StatusCode st = OK;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
Blob::Ptr inputValuesBlob;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk_input", inputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("topk_input"));
|
||||
|
||||
GenRandomData(inputValuesBlob);
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
Blob::Ptr outputValuesBlob, outputIndicesBlob;
|
||||
if (outputValues) {
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk.0", outputValuesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("topk.0"));
|
||||
}
|
||||
if (outputIndices) {
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk.1", outputIndicesBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(outputIndicesBlob = _inferRequest.GetBlob("topk.1"));
|
||||
}
|
||||
|
||||
const InferenceEngine::TensorDesc valuesDesc{dataPrecision, outputDims, defaultLayout(outputDims.size())};
|
||||
|
@ -139,9 +139,6 @@ R"V0G0N(
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
InferenceEngine::StatusCode st = InferenceEngine::OK;
|
||||
InferenceEngine::ResponseDesc resp;
|
||||
|
||||
InferenceEngine::TBlob<uint8_t> *weights_raw = new InferenceEngine::TBlob<uint8_t>(
|
||||
{InferenceEngine::Precision::U8,
|
||||
{indices.size() * sizeof(ie_fp16)},
|
||||
|
@ -18,8 +18,6 @@ public:
|
||||
};
|
||||
|
||||
TEST_P(myriadGetOutput_nightly, AddOutput) {
|
||||
StatusCode st;
|
||||
|
||||
name_model_full = (*(std::get<0>(std::get<0>(GetParam()))));
|
||||
name_model_crop = (*(std::get<1>(std::get<0>(GetParam()))));
|
||||
name_output = std::get<1>(GetParam());
|
||||
@ -39,26 +37,19 @@ TEST_P(myriadGetOutput_nightly, AddOutput) {
|
||||
|
||||
InferenceEngine::Blob::Ptr inputBlob;
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetwork;
|
||||
InferenceEngine::ExecutableNetwork exeNetwork;
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, crop_network, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(crop_network, networkConfig));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequest;
|
||||
ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp));
|
||||
InferenceEngine::InferRequest inferRequest;
|
||||
ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest());
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(networkInputs.begin()->first.c_str(), inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob(networkInputs.begin()->first.c_str()));
|
||||
GenRandomData(inputBlob);
|
||||
|
||||
InferenceEngine::Blob::Ptr output_crop;
|
||||
ASSERT_NO_THROW(st = inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequest->GetBlob(networkOutputs.begin()->first.c_str(), output_crop, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequest.Infer());
|
||||
ASSERT_NO_THROW(output_crop = inferRequest.GetBlob(networkOutputs.begin()->first.c_str()));
|
||||
|
||||
/*Full Network Infer */
|
||||
|
||||
@ -66,31 +57,24 @@ TEST_P(myriadGetOutput_nightly, AddOutput) {
|
||||
|
||||
full_network.addOutput(name_output, 0);
|
||||
|
||||
InferenceEngine::InputsDataMap networkInputsFull;
|
||||
networkInputsFull = full_network.getInputsInfo();
|
||||
InferenceEngine::OutputsDataMap networkOutputsFull;
|
||||
networkOutputsFull = full_network.getOutputsInfo();
|
||||
InferenceEngine::InputsDataMap networkInputsFull = full_network.getInputsInfo();
|
||||
InferenceEngine::OutputsDataMap networkOutputsFull = full_network.getOutputsInfo();
|
||||
|
||||
networkInputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
networkOutputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
(++networkOutputsFull.begin())->second->setPrecision(InferenceEngine::Precision::FP16);
|
||||
|
||||
InferenceEngine::IExecutableNetwork::Ptr exeNetworkFull;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetworkFull, full_network, networkConfig, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::ExecutableNetwork exeNetworkFull;
|
||||
ASSERT_NO_THROW(exeNetworkFull = _vpuPluginPtr->LoadNetwork(full_network, networkConfig));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr inferRequestFull;
|
||||
ASSERT_NO_THROW(st = exeNetworkFull->CreateInferRequest(inferRequestFull, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferenceEngine::InferRequest inferRequestFull;
|
||||
ASSERT_NO_THROW(inferRequestFull = exeNetworkFull.CreateInferRequest());
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequestFull->SetBlob("data", inputBlob, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequestFull.SetBlob("data", inputBlob));
|
||||
|
||||
InferenceEngine::Blob::Ptr output_full;
|
||||
ASSERT_NO_THROW(st = inferRequestFull->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(st = inferRequestFull->GetBlob(name_output.c_str(), output_full, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequestFull.Infer());
|
||||
ASSERT_NO_THROW(output_full = inferRequestFull.GetBlob(name_output.c_str()));
|
||||
|
||||
CompareCommonAbsolute(output_full, output_crop, 0.0f);
|
||||
}
|
||||
|
@ -28,9 +28,7 @@ TEST_F(myriadGetPerformanceTests_nightly, CorrectTimings) {
|
||||
|
||||
ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr));
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork,
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork,
|
||||
{
|
||||
{
|
||||
CONFIG_KEY(PERF_COUNT),
|
||||
@ -40,23 +38,18 @@ TEST_F(myriadGetPerformanceTests_nightly, CorrectTimings) {
|
||||
CONFIG_KEY(LOG_LEVEL),
|
||||
CONFIG_VALUE(LOG_WARNING)
|
||||
}
|
||||
}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
}));
|
||||
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
time_point start = Time::now();
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
time_point end = Time::now();
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
time_point end = Time::now();
|
||||
double inferTime_mSec = (std::chrono::duration_cast<ms>(end - start)).count();
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
long long stagesTime_uSec = 0;
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
long long stagesTime_uSec = 0;
|
||||
for (const auto &i : perfMap) {
|
||||
stagesTime_uSec += i.second.realTime_uSec;
|
||||
}
|
||||
|
@ -660,37 +660,28 @@ TEST_F(MyriadX_HW_Tests_nightly, With_3_FC_Layers) {
|
||||
GenRandomData(input);
|
||||
|
||||
Blob::Ptr swOutput, hwOutput;
|
||||
_inferRequest.reset();
|
||||
_exeNetwork.reset();
|
||||
_inferRequest = {};
|
||||
_exeNetwork = {};
|
||||
|
||||
StatusCode st;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network,
|
||||
{
|
||||
{
|
||||
InferenceEngine::MYRIAD_PERF_REPORT_MODE,
|
||||
InferenceEngine::MYRIAD_PER_STAGE
|
||||
},
|
||||
{
|
||||
InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION,
|
||||
CONFIG_VALUE(YES)
|
||||
},
|
||||
}));
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network,
|
||||
{
|
||||
{
|
||||
InferenceEngine::MYRIAD_PERF_REPORT_MODE,
|
||||
InferenceEngine::MYRIAD_PER_STAGE
|
||||
},
|
||||
{
|
||||
InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION,
|
||||
CONFIG_VALUE(YES)
|
||||
},
|
||||
},
|
||||
&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("input", input));
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("input", input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
std::vector<float> results(sizeof(names) / sizeof(names[0]));
|
||||
for (size_t i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(names[i].c_str(), hwOutput, &_resp));
|
||||
ASSERT_NO_THROW(hwOutput = _inferRequest.GetBlob(names[i].c_str()));
|
||||
ASSERT_NE(hwOutput, nullptr);
|
||||
BufferWrapper res_ptr(hwOutput);
|
||||
results[i] = res_ptr[0];
|
||||
|
@ -78,23 +78,15 @@ public:
|
||||
{ InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE }
|
||||
};
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
IInferRequest::Ptr inferRequests[NUM_REQUESTS];
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, config));
|
||||
|
||||
InferRequest inferRequests[NUM_REQUESTS];
|
||||
Blob::Ptr outputs[NUM_REQUESTS];
|
||||
|
||||
for (int i = 0; i < NUM_REQUESTS; ++i) {
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequests[i], &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequests[i]->SetBlob(_cnnNetwork.getInputsInfo().begin()->first.c_str(), _input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = inferRequests[i]->GetBlob(_cnnNetwork.getOutputsInfo().begin()->first.c_str(), outputs[i], &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequests[i] = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(inferRequests[i].SetBlob(_cnnNetwork.getInputsInfo().begin()->first.c_str(), _input));
|
||||
ASSERT_NO_THROW(outputs[i] = inferRequests[i].GetBlob(_cnnNetwork.getOutputsInfo().begin()->first.c_str()));
|
||||
}
|
||||
|
||||
std::vector<Blob::Ptr> allOutputs[NUM_REQUESTS];
|
||||
@ -104,13 +96,11 @@ public:
|
||||
|
||||
for (int iterInd = 0; iterInd < numIters; ++iterInd) {
|
||||
for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) {
|
||||
ASSERT_NO_THROW(st = inferRequests[inferInd]->StartAsync(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(inferRequests[inferInd].StartAsync());
|
||||
}
|
||||
|
||||
for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) {
|
||||
ASSERT_NO_THROW(st = inferRequests[inferInd]->Wait(IInferRequest::RESULT_READY, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_EQ(StatusCode::OK, inferRequests[inferInd].Wait(IInferRequest::RESULT_READY));
|
||||
}
|
||||
|
||||
for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) {
|
||||
|
@ -32,12 +32,9 @@ struct RunInfo {
|
||||
class MyriadX_HW_Tests_nightly : public myriadLayersTests_nightly {
|
||||
public:
|
||||
void CheckHWRun() {
|
||||
StatusCode st;
|
||||
|
||||
std::map<std::string, InferenceEngineProfileInfo> perfMap;
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts());
|
||||
|
||||
std::vector<std::pair<std::string, InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngineProfileInfo> &pair1,
|
||||
@ -120,10 +117,8 @@ public:
|
||||
const char* outputName,
|
||||
const RunInfo& runInfo,
|
||||
const std::string& logLevel = CONFIG_VALUE(LOG_NONE)) {
|
||||
_inferRequest.reset();
|
||||
_exeNetwork.reset();
|
||||
|
||||
StatusCode st;
|
||||
_inferRequest = {};
|
||||
_exeNetwork = {};
|
||||
|
||||
std::map<std::string, std::string> config = {
|
||||
{ InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, runInfo.hwMode ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO) },
|
||||
@ -134,20 +129,11 @@ public:
|
||||
{ CONFIG_KEY(LOG_LEVEL), logLevel }
|
||||
};
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, config, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob(inputName, input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->GetBlob(outputName, output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob(inputName, input));
|
||||
ASSERT_NO_THROW(output = _inferRequest.GetBlob(outputName));
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
}
|
||||
|
||||
void CompareWithSW(float errorThreshold, vpu::LayoutPreference layoutPreference = vpu::LayoutPreference::ChannelMajor) {
|
||||
|
@ -48,8 +48,6 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) {
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
StatusCode st;
|
||||
|
||||
ASSERT_NO_THROW(readNetwork(model));
|
||||
|
||||
const auto& network = _cnnNetwork;
|
||||
@ -60,12 +58,8 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) {
|
||||
_outputsInfo = network.getOutputsInfo();
|
||||
_outputsInfo["power"]->setPrecision(Precision::FP16);
|
||||
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
auto dims = _inputsInfo["data"]->getTensorDesc().getDims();
|
||||
|
||||
@ -89,23 +83,12 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) {
|
||||
inputNCHW->buffer().as<ie_fp16*>()[tensorDescNCHW.offset(i)] = inputNHWC->cbuffer().as<const ie_fp16*>()[tensorDescNHWC.offset(i)];
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNHWC, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("power", outputNHWC, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNCHW, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->SetBlob("power", outputNCHW, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNHWC));
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("power", outputNHWC));
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNCHW));
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob("power", outputNCHW));
|
||||
ASSERT_NO_THROW(_inferRequest.Infer());
|
||||
|
||||
CompareCommonAbsolute(outputNHWC, outputNCHW, 0.0);
|
||||
}
|
||||
@ -222,8 +205,6 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) {
|
||||
</Net>
|
||||
)V0G0N";
|
||||
|
||||
StatusCode st;
|
||||
|
||||
TBlob<uint8_t>::Ptr weights(GenWeights(8320 / sizeof(ie_fp16)));
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
@ -241,23 +222,14 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) {
|
||||
|
||||
Blob::Ptr conv_output;
|
||||
{
|
||||
IExecutableNetwork::Ptr conv_exe;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(conv_exe, conv_network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(conv_exe, nullptr) << _resp.msg;
|
||||
ExecutableNetwork conv_exe;
|
||||
ASSERT_NO_THROW(conv_exe = _vpuPluginPtr->LoadNetwork(conv_network));
|
||||
|
||||
IInferRequest::Ptr conv_req;
|
||||
ASSERT_NO_THROW(st = conv_exe->CreateInferRequest(conv_req, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = conv_req->SetBlob("input", input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = conv_req->GetBlob("conv", conv_output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = conv_req->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest conv_req;
|
||||
ASSERT_NO_THROW(conv_req = conv_exe.CreateInferRequest());
|
||||
ASSERT_NO_THROW(conv_req.SetBlob("input", input));
|
||||
ASSERT_NO_THROW(conv_output = conv_req.GetBlob("conv"));
|
||||
ASSERT_NO_THROW(conv_req.Infer());
|
||||
}
|
||||
|
||||
auto full_network = ie.ReadNetwork(full_model, weights);
|
||||
@ -273,23 +245,14 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) {
|
||||
|
||||
Blob::Ptr full_output;
|
||||
{
|
||||
IExecutableNetwork::Ptr full_exe;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(full_exe, full_network, {}, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(full_exe, nullptr) << _resp.msg;
|
||||
ExecutableNetwork full_exe;
|
||||
ASSERT_NO_THROW(full_exe = _vpuPluginPtr->LoadNetwork(full_network));
|
||||
|
||||
IInferRequest::Ptr full_req;
|
||||
ASSERT_NO_THROW(st = full_exe->CreateInferRequest(full_req, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = full_req->SetBlob("input", input, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = full_req->GetBlob("conv", full_output, &_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
ASSERT_NO_THROW(st = full_req->Infer(&_resp));
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
InferRequest full_req;
|
||||
ASSERT_NO_THROW(full_req = full_exe.CreateInferRequest());
|
||||
ASSERT_NO_THROW(full_req.SetBlob("input", input));
|
||||
ASSERT_NO_THROW(full_output = full_req.GetBlob("conv"));
|
||||
ASSERT_NO_THROW(full_req.Infer());
|
||||
}
|
||||
|
||||
CompareCommonAbsolute(full_output, conv_output, 0.0f);
|
||||
|
@ -49,8 +49,7 @@ public:
|
||||
|
||||
IE_ASSERT(generateNetAndInfer(NetworkInitParams().useHWOpt(CheckMyriadX()).runRefGraph(false)));
|
||||
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
|
||||
executionMicroseconds = 0;
|
||||
for (const auto& perfPair : perfMap) {
|
||||
|
@ -53,8 +53,8 @@ void graphTransformerFunctionalTests::PrepareGraphCompilation() {
|
||||
// For the new network plugin tries to find new free device first (already booted or not booted),
|
||||
// then to reuse busy devices. If we release the executable network, it marks its device as free and booted.
|
||||
// Next network will find such device and will use it without boot, which is the fastest case.
|
||||
_executableNetwork = ExecutableNetwork();
|
||||
_inferRequest = nullptr;
|
||||
_executableNetwork = {};
|
||||
_inferRequest = {};
|
||||
|
||||
CreateModel();
|
||||
}
|
||||
@ -101,8 +101,7 @@ int64_t graphTransformerFunctionalTests::CompileAndInfer(Blob::Ptr& inputBlob, B
|
||||
|
||||
IE_ASSERT(Infer());
|
||||
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
|
||||
int64_t executionMicroseconds = 0;
|
||||
for (const auto& perfPair : perfMap) {
|
||||
|
@ -21,45 +21,37 @@ typedef myriadLayerTestBaseWithParam<config_t> myriadIncorrectModelsConfigsTests
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
TEST_P(myriadCorrectModelsConfigsTests_nightly, LoadNetworkWithCorrectConfig) {
|
||||
InferenceEngine::ResponseDesc response;
|
||||
const auto &config = GetParam();
|
||||
DISABLE_IF(!hasAppropriateStick(config));
|
||||
|
||||
InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat());
|
||||
InferenceEngine::IExecutableNetwork::Ptr executable;
|
||||
InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response);
|
||||
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg;
|
||||
InferenceEngine::ExecutableNetwork executable;
|
||||
ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config));
|
||||
}
|
||||
|
||||
TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithAvailableDevice) {
|
||||
InferenceEngine::ResponseDesc response;
|
||||
const auto &config = GetParam();
|
||||
DISABLE_IF(!hasAppropriateStick(config));
|
||||
|
||||
InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat());
|
||||
InferenceEngine::IExecutableNetwork::Ptr executable;
|
||||
InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response);
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg;
|
||||
InferenceEngine::ExecutableNetwork executable;
|
||||
ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr request;
|
||||
sts = executable->CreateInferRequest(request, &response);
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg;
|
||||
InferenceEngine::InferRequest request;
|
||||
ASSERT_NO_THROW(request = executable.CreateInferRequest());
|
||||
}
|
||||
|
||||
TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithUnavailableDevice) {
|
||||
InferenceEngine::ResponseDesc response;
|
||||
const auto &config = GetParam();
|
||||
DISABLE_IF(hasAppropriateStick(config));
|
||||
|
||||
InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat());
|
||||
InferenceEngine::IExecutableNetwork::Ptr executable;
|
||||
InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response);
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg;
|
||||
InferenceEngine::ExecutableNetwork executable;
|
||||
ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config));
|
||||
|
||||
InferenceEngine::IInferRequest::Ptr request;
|
||||
sts = executable->CreateInferRequest(request, &response);
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, sts) << response.msg;
|
||||
InferenceEngine::InferRequest request;
|
||||
ASSERT_THROW(request = executable.CreateInferRequest(),
|
||||
InferenceEngine::details::InferenceEngineException);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -67,14 +59,12 @@ TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithUnavailabl
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
TEST_P(myriadIncorrectModelsConfigsTests_nightly, LoadNetworkWithIncorrectConfig) {
|
||||
InferenceEngine::ResponseDesc response;
|
||||
const auto &config = GetParam();
|
||||
|
||||
InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat());
|
||||
InferenceEngine::IExecutableNetwork::Ptr executable;
|
||||
InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response);
|
||||
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, sts) << response.msg;
|
||||
InferenceEngine::ExecutableNetwork executable;
|
||||
ASSERT_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config),
|
||||
InferenceEngine::details::InferenceEngineException);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -17,12 +17,9 @@ typedef myriadLayerTestBaseWithParam<num_graphs> myriadMultipleGraphsTests_night
|
||||
TEST_P(myriadMultipleGraphsTests_nightly, LoadGraphsOnDevice) {
|
||||
ASSERT_NO_THROW(_cnnNetwork = InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat()));
|
||||
const int num_graphs = GetParam();
|
||||
StatusCode st;
|
||||
std::vector<InferenceEngine::IExecutableNetwork::Ptr> exeNetwork(num_graphs);
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
std::vector<InferenceEngine::ExecutableNetwork> exeNetworks(num_graphs);
|
||||
for (int i = 0; i < num_graphs; ++i) {
|
||||
st = _vpuPluginPtr->LoadNetwork(exeNetwork[i], _cnnNetwork, networkConfig, &_resp);
|
||||
ASSERT_EQ(StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NO_THROW(exeNetworks[i] = _vpuPluginPtr->LoadNetwork(_cnnNetwork));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ void vpuLayersTests::TearDown() {
|
||||
_cnnNetwork.serialize(xmlName, weightsName);
|
||||
|
||||
std::string blobName = filename + ".blob";
|
||||
_exeNetwork->Export(blobName, nullptr);
|
||||
ASSERT_NO_THROW(_exeNetwork.Export(blobName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,8 +76,7 @@ Blob::Ptr vpuLayersTests::getReferenceOutput() {
|
||||
}
|
||||
|
||||
void vpuLayersTests::dumpPerformance() {
|
||||
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
std::vector <std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>> perfVec(perfMap.begin(), perfMap.end());
|
||||
std::sort(perfVec.begin(), perfVec.end(),
|
||||
[=](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo> &pair1,
|
||||
@ -96,8 +95,7 @@ void vpuLayersTests::dumpPerformance() {
|
||||
}
|
||||
|
||||
bool vpuLayersTests::wasCustomLayerInferred() const {
|
||||
auto perfMap = std::map<std::string, InferenceEngine::InferenceEngineProfileInfo>{};
|
||||
_inferRequest->GetPerformanceCounts(perfMap, nullptr);
|
||||
auto perfMap = _inferRequest.GetPerformanceCounts();
|
||||
const auto isCustomLayer = [&](const std::pair<std::string, InferenceEngine::InferenceEngineProfileInfo>& info) {
|
||||
return !strcmp(info.second.exec_type, "Custom");
|
||||
};
|
||||
@ -143,7 +141,7 @@ void vpuLayersTests::genInputBlobs(bool lockLayout) {
|
||||
ASSERT_NE(genDataCallback, nullptr);
|
||||
genDataCallback(inputBlob);
|
||||
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, _inferRequest->SetBlob(input.first.c_str(), inputBlob, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob(input.first.c_str(), inputBlob));
|
||||
|
||||
_inputMap[input.first] = inputBlob;
|
||||
genDataCallback = _genDataCallback;
|
||||
@ -158,7 +156,7 @@ void vpuLayersTests::genOutputBlobs(bool lockLayout) {
|
||||
for (const auto& output : _outputsInfo) {
|
||||
auto outputBlob = allocateBlob(output.second, lockLayout);
|
||||
|
||||
ASSERT_EQ(InferenceEngine::StatusCode::OK, _inferRequest->SetBlob(output.first.c_str(), outputBlob, &_resp)) << _resp.msg;
|
||||
ASSERT_NO_THROW(_inferRequest.SetBlob(output.first.c_str(), outputBlob));
|
||||
|
||||
_outputMap[output.first] = outputBlob;
|
||||
}
|
||||
@ -186,12 +184,8 @@ void vpuLayersTests::createInferRequest(const NetworkParams& params) {
|
||||
config[InferenceEngine::MYRIAD_PERF_REPORT_MODE] = InferenceEngine::MYRIAD_PER_STAGE;
|
||||
config[InferenceEngine::MYRIAD_FORCE_DEPRECATED_CNN_CONVERSION] = CONFIG_VALUE(NO); // Make VPU plugin be able to use NGraph network.
|
||||
|
||||
InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR;
|
||||
ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, config, &_resp));
|
||||
ASSERT_NE(_exeNetwork, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg;
|
||||
ASSERT_EQ((int) InferenceEngine::StatusCode::OK, st) << _resp.msg;
|
||||
ASSERT_NE(_inferRequest, nullptr) << _resp.msg;
|
||||
ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, config));
|
||||
ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest());
|
||||
|
||||
genInputBlobs(params._lockLayout);
|
||||
genOutputBlobs(params._lockLayout);
|
||||
@ -246,13 +240,12 @@ void vpuLayersTests::readNetwork(const std::string& modelFilename, const std::st
|
||||
}
|
||||
|
||||
bool vpuLayersTests::Infer() {
|
||||
if (_inferRequest == nullptr ||
|
||||
_inputMap.empty() ||
|
||||
_outputMap.empty())
|
||||
if (_inputMap.empty() || _outputMap.empty())
|
||||
return false;
|
||||
const auto st = _inferRequest->Infer(&_resp);
|
||||
EXPECT_EQ(InferenceEngine::StatusCode::OK, st) << _resp.msg;
|
||||
|
||||
_inferRequest.Infer();
|
||||
// dumpPerformance();
|
||||
|
||||
if (!_config[InferenceEngine::MYRIAD_CUSTOM_LAYERS].empty()) {
|
||||
EXPECT_TRUE(wasCustomLayerInferred())
|
||||
<< "CustomBindings.xml has been provided but Custom layer was not inferred";
|
||||
@ -271,8 +264,8 @@ bool vpuLayersTests::generateNetAndInfer(const NetworkParams& params) {
|
||||
|
||||
void vpuLayersTests::ResetGeneratedNet() {
|
||||
SetSeed(DEFAULT_SEED_VALUE);
|
||||
_exeNetwork.reset();
|
||||
_inferRequest.reset();
|
||||
_exeNetwork = {};
|
||||
_inferRequest = {};
|
||||
}
|
||||
|
||||
void vpuLayersTests::ResetReferenceLayers() {
|
||||
|
@ -111,20 +111,19 @@ protected:
|
||||
void createInferRequest(const NetworkParams& params);
|
||||
|
||||
protected:
|
||||
IECoreAdapter::Ptr _vpuPluginPtr;
|
||||
IECoreAdapter::Ptr _vpuPluginPtr;
|
||||
|
||||
std::map<std::string, std::string> _config;
|
||||
|
||||
IRVersion _irVersion = IRVersion::v7;
|
||||
|
||||
InferenceEngine::CNNNetwork _cnnNetwork;
|
||||
InferenceEngine::ResponseDesc _resp;
|
||||
InferenceEngine::InputsDataMap _inputsInfo;
|
||||
InferenceEngine::BlobMap _inputMap;
|
||||
InferenceEngine::BlobMap _outputMap;
|
||||
InferenceEngine::OutputsDataMap _outputsInfo;
|
||||
InferenceEngine::IExecutableNetwork::Ptr _exeNetwork;
|
||||
InferenceEngine::IInferRequest::Ptr _inferRequest;
|
||||
InferenceEngine::ExecutableNetwork _exeNetwork;
|
||||
InferenceEngine::InferRequest _inferRequest;
|
||||
|
||||
InferenceEngine::Blob::Ptr _refBlob;
|
||||
VpuTestNet _testNet;
|
||||
|
Loading…
Reference in New Issue
Block a user