Closed aungthetnaing closed 5 years ago
The following patch fixes the issue:
From 7807070966457f5e225ad0d03daaec6e84ce23d2 Mon Sep 17 00:00:00 2001
From: Aung Naing <aung.t.naing@intel.com>
Date: Thu, 10 Oct 2019 22:12:24 -0700
Subject: [PATCH] [#505] Fix error thrown from SetBatch in VPUs
VPU calls base implementation which is to throw error for SetBatch.
https://github.com/opencv/open_model_zoo/issues/505
Signed-off-by: Aung Naing <aung.t.naing@intel.com>
---
demos/pedestrian_tracker_demo/main.cpp | 6 +++++-
demos/pedestrian_tracker_demo/src/cnn.cpp | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/demos/pedestrian_tracker_demo/main.cpp b/demos/pedestrian_tracker_demo/main.cpp
index 703017f..8978e11 100644
--- a/demos/pedestrian_tracker_demo/main.cpp
+++ b/demos/pedestrian_tracker_demo/main.cpp
@@ -51,7 +51,11 @@ CreatePedestrianTracker(const std::string& reid_model,
if (!reid_model.empty() && !reid_weights.empty()) {
CnnConfig reid_config(reid_model, reid_weights);
- reid_config.max_batch_size = 16;
+ reid_config.max_batch_size = 16; // defaulting to 16
+ if ((deviceName.find("MYRIAD") != std::string::npos) || (deviceName.find("HDDL") != std::string::npos)) {
+ reid_config.max_batch_size = 1;
+ }
+
std::shared_ptr<IImageDescriptor> descriptor_strong =
std::make_shared<DescriptorIE>(reid_config, ie, deviceName);
diff --git a/demos/pedestrian_tracker_demo/src/cnn.cpp b/demos/pedestrian_tracker_demo/src/cnn.cpp
index 5056c05..8ad9b5e 100644
--- a/demos/pedestrian_tracker_demo/src/cnn.cpp
+++ b/demos/pedestrian_tracker_demo/src/cnn.cpp
@@ -77,7 +77,11 @@ void CnnBase::InferBatch(
matU8ToBlob<uint8_t>(frames[batch_i + b], input_blob_, b);
}
- infer_request_.SetBatch(current_batch_size);
+ if ((deviceName_.find("MYRIAD") == std::string::npos) && (deviceName_.find("HDDL") == std::string::npos)) {
+ infer_request_.SetBatch(current_batch_size); // std::cout << "No batch support for " << deviceName_ << std::endl << std::endl;
+ }
+
+
infer_request_.Infer();
fetch_results(outputs_, current_batch_size);
--
2.7.4
How to get a push access to this repo?
I'll try against R3 again..
No issue on 2019R3
Incorrect testing; still observable in 2019 R3
InferenceEngine:
API version ............ 2.1
Build .................. custom_releases/2019/R3_cb6cad9663aea3d282e0e8b3e0bf359df665d5d0
Description ....... API
Parsing input parameters
Loading device MYRIAD
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 30677
To close the application, press 'CTRL+C' here or switch to the output window and press ESC key
[ ERROR ] Dynamic batch is not supported
How to get a push access to this repo?
You can submit a pull request.
The provided patch looks good. I would only suggest
std::cout << "No batch support for " << deviceName_ << std::endl << std::endl;
: put it after reid_config.max_batch_size = 1;
and slightly clarify the message:
std::cerr
<< "No dynamic
batch support for " << deviceName_ << ". Fall back to batch 1\n"; no second std::endl
@aungthetnaing, will you submit the update, or should I do it?
What's the procedure to create a PR? I tried this way.
git push origin HEAD:
I was giving error of no access rights..
I'm traveling right now. If I have access rights, I could create a PR when I'm back next week.
You should create a fork and push updates to it and than request a merge of your fork with the original repo.
I did the following:
git checkout -b test_psh
git add
I'm getting the following:
remote: Permission to opencv/open_model_zoo.git denied to aungthetnaing. fatal: unable to access 'https://github.com/opencv/open_model_zoo.git/': The requested URL returned error: 403
So that mean my github ID needs to go through some kind of access granting process.
The procedure is slightly more complex:
1) there is a Fork
button at the top of this page. Clicking it will create a copy of open_model_zoo: it will be https://github.com/aungthetnaing/open_model_zoo
for you.
2) Clone that copied repo (alternative solution could be messing with git remotes like git remote add -f aungthetnaing https://github.com/aungthetnaing/open_model_zoo
which allows to keep multiple remotes in the same local git repo).
3) do updates and push to your
repo.
4) open your repo on github and it will suggest to submit a pull request.
close as implemented
Why don't VPU support dynamic batch?
It is still the issue even after forcing batch size of 1. No issue with CPU