Closed ericvanbuhler closed 4 years ago
Hi
You got the error message "Permutation AxisVector{0, 3, 1400398157, 1350070082} is not valid for input shape {1,24,1,1}" because we cannot validate graph. How did you get IR files? Do you use OpenCV to execute?
@ilyachur Thanks for taking a look! I used OpenCV with OpenVINO as the inference engine backend, and used the files provided for each model (caffe for 1, tensorflow for 2) as input to cv2.dnn.readNet()
. I believe the conversion to IR happens at runtime, but I'm not sure where that happens.
@dkurt could you comment, how OpenCV generates ngraph function?
I'd like to recommend to wait for publication of 2020.4 archive of OpenVINO for Raspberry Pi.
@dkurt What's the difference between what I've built and the archive for Raspberry Pi? I'm happy to wait, but I just want to make sure that I can still use it in the same way I am now. Most importantly, that I can still use it as the inference engine backend of OpenCV.
OpenVINO: 2020.4 OpenCV: 4.4.0-openvino
@ericvanbuhler, have you used exactly commits under these tags?
https://github.com/openvinotoolkit/openvino/tree/2020.4
https://github.com/opencv/opencv/tree/4.4.0-openvino
@dkurt Yes, I believe so. Here are the steps I did to check out OpenVINO and OpenCV:
git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git checkout 2020.4
git submodule update --init --recursive
<build OpenVINO>
...
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.4.0-openvino.zip
unzip opencv.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.4.0.zip
unzip opencv_contrib.zip
<build OpenCV>
@ericvanbuhler , sorry for late response. I were able to reproduce a problem:
terminate called after throwing an instance of 'ngraph::NodeValidationFailure'
what(): Check 'is_valid_permutation(permutation, arg_shape.rank())' failed at /openvino/ngraph/src/ngraph/op/transpose.cpp:65:
While validating node 'v1::Transpose Transpose_181(Add_179[0]:f32{1,12,19,19}, Constant_180[0]:i64{4}) -> (dynamic?)':
Permutation AxisVector{0, 3, 1952804193, 32} is not valid for input shape {1,12,19,19}
Aborted
this is my Dockerfile: https://gist.github.com/dkurt/585f886a000d3afade62f66c25640148
OpenCV: https://github.com/opencv/opencv/commit/a2f7ef9d210e5be5741c6e3109c233672534a1ed OpenVINO: https://github.com/openvinotoolkit/openvino/commit/6c3b7ee8cab5b6d7cd3c82f73cae32163a8c9472
I've decided to setup my own build and test nightly infrastructure for OpenVINO on Raspberry Pi with NCS2: https://github.com/dkurt/vineyard. For now there are failed tests including mentioned error:
[ RUN ] Test_ONNX_layers.ReduceL2/0, where GetParam() = NGRAPH/MYRIAD
unknown file: Failure
C++ exception with description "Check 'is_valid_permutation(permutation, arg_shape.rank())' failed at /openvino/ngraph/src/ngraph/op/transpose.cpp:65:
While validating node 'v1::Transpose Transpose_482932(Multiply_482930[0]:f32{1,3,2,4}, Constant_482931[0]:i64{4}) -> (dynamic?)':
Permutation AxisVector{0, 3, 24, 30177192} is not valid for input shape {1,3,2,4}
" thrown in the test body.
@dkurt Thanks for your work on this issue! Your build and test infrastructure will help resolve this and hopefully anything else that comes up on RPi + OpenVINO + NCS2. It's a really important use case for me!
@ericvanbuhler, https://github.com/opencv/opencv/pull/17998 going to fix it (12 failed tests against 31 - the rest are minor ones related to deprecated IR version).
I'll give it a shot in the morning, thanks for sharing the PR.
@ericvanbuhler, opencv/opencv#17998 going to fix it (12 failed tests against 31 - the rest are minor ones related to deprecated IR version).
Thanks I have tried this now. I get a cmake error if I try to compile with OpenCV Contrib but thats to do with compiling unmatched branches, I'll just wait until the fix has made its way to master before I use contrib again.
Having said that, I can now successfully forward darknet models 👍 Thanks!
Edit: Removed the issue I had, I figured out the problem was I wasn't passing the output layers to the dnn.forward()
@dkurt Awesome! I'll try it out as well this week.
Versions
Background
I'm having issues performing inference using OpenVINO with OpenCV's DNN backend. The models I've tried are two mobilenet SSD models:
I saw this error on OpenVINO 2020.3.0 with OpenCV 4.3.0-openvino, but found issue https://github.com/NervanaSystems/ngraph/issues/4794 which looked like it might be related, and saw that the fix (https://github.com/NervanaSystems/ngraph/pull/4745) was going into OpenVINO 2020.4 so I decided to wait and give it a try. Unfortunately the issue persists in 2020.4. I see a similar issue posted recently (https://github.com/openvinotoolkit/openvino/issues/1477) but the crash signature seemed different enough that I decided to add mine as well.
I compiled OpenVINO and OpenCV using nearly the same build flags (changing only architecture specific ones) for x86_64 and aarch64 and both of those work correctly. Also, I was using a similar build process with OpenVINO 2019_R3.1 and OpenCV 4.1.2 and those models were working on the NCS2.
Issue
I see the following crash when I perform an inference with the first model above:
I see a similar error with the second model as well.
Reproduce
I built OpenVINO with the following CMake flags:
and OpenCV with the following CMake flags:
Then ran
net.forward()
using the models listed above.Regards, Eric