-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenVINO 2020.1 doesn't work on Raspberry Pi and NCS2 #411
Comments
Is it possible to share the model you have tried to run? |
Hello @tgonzalez89 Best regards, Max. |
@maxl16 |
Hi @natxopedreira |
Thanks @maxl16 Latest one is the same as mentioned in this issue, i think... i tried but not work and im using 2019 models but in 2020 there are more face models that want to try but i do not find a way of do it? Will they work on opencv? Do you know when is going to be release a 2020 compatible version on rpi?? Thank you |
@natxopedreira |
@maxl16 But to be sure i will test and post here the results, as a reference Recentky i tried compiling opencv last version from source but also do not work :( |
@maxl16 Thank you so much!!!!!! seems to work, did a fast test.... i didn't try all the models but i was able to load this one But this instead trows error, do you know why? maybe int8 models do not work?
|
@natxopedreira |
@maxl16 I assume that lastest folder is the best one? i mean models from folder 3 |
@maxl16 I tried full script, previous i tried directly on console and i dont know why dont trow an error... executing this code net = cv.dnn.readNet(model_face_xml,model_face_bin) Model downloaded from this trows this error
|
@natxopedreira |
Hi @maxl16 Thank you for your reply, but.... Models from this folder Using code
resume: Note: do not work, means same error mentioned in this thread .... will be faster if you can tell me which face models works |
OpenCV in OpenVINO 2020.2 has a bug for MYRIAD target (however with another message on x86 host). Should be fixed here: opencv/opencv#17134 Consider using IE API (see OpenModelZoo demos) or wait for the next OpenVINO release or recompile OpenCV from master branch. /cc @dkurt |
Ok, i will build opencv from master branch and try, will post here results. |
@alalek
|
@natxopedreira, please read the logs carefully - it's not OpenCV error,
|
@dkurt thank you! To be clear, sorry but i never say is an opencv error, @alalek mentioned that you can read two post up I followed their advice building opencv from master and error persist I also followed your advice applying those patches to ngraph and still doesn't work, ngraph people offered help but is asking for info i don't have Im open to ideas on how to solve this! |
@natxopedreira , according to the error message, binary OpenVINO is used, not a custom build you tried:
you need to clean build folder first then specify |
@dkurt Thank you I compiled openvino from source And still get that error As you can see here, is a custom build
Should i try to build openvino with a build opencv? |
So in resume What i have tried:
What else i can try? |
Give this a try.
Then download the 2019 R1 models such as:
I have a Pi 4 with the NCS 2 and it worked properly. Good luck! |
Thank you, yes that works, thats what im using. Problem here is that i want to use the new face models present on 2020 version..... and i can't. Also want to use opencv instead IE API because opencv is faster, at least in my tests So im forced to wait..... |
no idea if this helps ? but below is the code i'm using using open cv with the below cascade xml from picamera import PiCamera from time import sleep #width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) while True:
cap.release() |
Thank you!!! but i want to use a neural network, it works much better that haarcascade |
Hi guys, I'm facing the same error with a custom model on rasp 4 with ncs2. |
Hi @juvinski Sadly i think is no solution until there is a new openvino release, i tried compiling openvino, opencv, ngraph.... and nothing But as is a custom model you can try to use this flag "--generate_deprecated_IR_V7" when using the model optimizer to generate IR version, "with that flag you do a lower version model". Note im not an expert here but problem seems to happens when you want to inference with a IR10 version model, using older models (from 2019R3 release for example) works. Let us know if works! Good luck! |
Hi @natxopedreira , I tried and works ! Thanks |
Hi @juvinski Did you try a Model Optimizer flag "--generate_deprecated_IR_V7"? The issue affects only IR v10, but I was sure that the problem was resolved for the master branch. Could you please try to the last master branch? And provide an error and stacktrace if it doesn't work for your case. Thanks. |
@ilyachur Was this solved in a recent update on the master branch? |
@natxopedreira Yes, as I know the final fix was merged to the master branch 5 days ago (ca9a788) |
Ohhhh, thats great!!! Thanks for let us know @ilyachur i will build from master branch later and try, last time i tried was 8 days ago |
@natxopedreira Ok, cool! Please let us know about your results. |
I compiled from master branch and mixed results, let me explain. IECore seems to work but opencv is broken so i can not do infer on a sample image, i dont know if it will trow an error when call infer..... At least i was able to get to this point, this works no errorr
But importing opencv is trowing an error complaining about a lib that is not present when build |
NN Builder was deprecated several releases before and it is removed in the master branch. Can you check dependencies for your project? Maybe you have another version of inference engine in the environment. |
Note that this error is only doing Those are my enviroment vars pi@raspberrypi:~ $ echo $LD_LIBRARY_PATH pi@raspberrypi:~ $ echo $PYTHONPATH Those are the vars im setting pointing to the new install Here is it my cmake settings and Docker file But if you think is helpful i can do a fresh buster install and try it again? Im very interested in making this work and im happy to do all the test that are necesary Thank you |
@natxopedreira, you need to build IE first then build OpenCV. |
@dkurt thank you, so i need to build also opencv.... i was only building IE. Ok, i will build opencv agains openvino built from master branch |
@natxopedreira Thank you. |
@ilyachur No luck, im not able to build opencv from source Sure im doing something wrong but i dont know whats happening, note that im able to build opencv without making that change to use custom openvino build instead the one that downloads by default. /opencv/modules/dnn/src/op_inf_engine.cpp:50:2: error: #error "Build configuration error: nGraph or NN Builder API backend should be enabled" In cmake i put those vars pointing to openvino master build |
@dkurt sorry for disturbing, can you please tell me if you know that compiling current opencv master branch against a openvino built also from master branch works in this moment? I tried several times and always get same error, maybe building with that config is currently broken because of recent changes in openvino master branch Thank you |
@dkurt Can you help with OpenCV isssue? |
@natxopedreira, issues is related to nGraph API changes and that IE has no identificators for release version. Please specify release manually:
DockerfileFROM debian:buster
USER root
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
crossbuild-essential-armhf \
git \
wget \
cmake \
libusb-1.0-0-dev:armhf \
libgtk-3-dev:armhf \
libavcodec-dev:armhf \
libavformat-dev:armhf \
libswscale-dev:armhf \
libgstreamer1.0-dev:armhf \
libgstreamer-plugins-base1.0-dev:armhf \
libpython3-dev:armhf \
libpython-dev:armhf \
python3-numpy \
python-numpy \
python3-pip
# Build Inference Engine (https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md#build-for-raspbian-stretch-os)
RUN git clone https://github.com/openvinotoolkit/openvino
RUN cd openvino && mkdir build && cd build && \
git submodule init && git submodule update --recursive && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="../cmake/arm.toolchain.cmake" \
-DTHREADS_PTHREAD_ARG="-pthread" \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DNGRAPH_ONNX_IMPORT_ENABLE=OFF \
-DENABLE_GNA=OFF .. && make --jobs=$(nproc --all)
# Build OpenCV (https://github.com/opencv/opencv/wiki/Intel%27s-Deep-Learning-Inference-Engine-backend#raspbian-buster)
RUN git clone https://github.com/opencv/opencv --depth 1
RUN cd opencv && mkdir opencv_build && mkdir opencv_install && cd opencv_build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="../opencv_install" \
-DOPENCV_CONFIG_INSTALL_PATH="cmake" \
-DCMAKE_TOOLCHAIN_FILE="../platforms/linux/arm-gnueabi.toolchain.cmake" \
-DWITH_IPP=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DOPENCV_ENABLE_PKG_CONFIG=ON \
-DPKG_CONFIG_EXECUTABLE="/usr/bin/arm-linux-gnueabihf-pkg-config" \
-DPYTHON2_INCLUDE_PATH="/usr/include/python2.7" \
-DPYTHON2_NUMPY_INCLUDE_DIRS="/usr/local/lib/python2.7/dist-packages/numpy/core/include" \
-DPYTHON3_INCLUDE_PATH="/usr/include/python3.7" \
-DPYTHON3_NUMPY_INCLUDE_DIRS="/usr/local/lib/python3.7/dist-packages/numpy/core/include" \
-DPYTHON3_CVPY_SUFFIX=".cpython-37m-arm-linux-gnueabihf.so" \
-DENABLE_NEON=ON \
-DCPU_BASELINE="NEON" \
-DWITH_INF_ENGINE=ON \
-DINF_ENGINE_RELEASE=2020040000 \
-DINF_ENGINE_LIB_DIRS="/openvino/bin/armv7l/Release/lib/" \
-DINF_ENGINE_INCLUDE_DIRS="/openvino/inference_engine/include" \
-DCMAKE_FIND_ROOT_PATH="/openvino/build" .. && \
make --jobs=$(nproc --all) && make install |
@dkurt @ilyachur Thank you!! it works but i think something is wrong here. 3 seconds to do an inference on a 320x240 image!!!
|
Do warmup runs before actual efficiency measurements. Like here: opencv/opencv#17295 (comment). |
@dkurt
/opt/intel/opencv/opencv_install/lib/python3.7/dist-packages/cv2/python-3.7/cv2.cpython-37m-arm-linux-gnueabihf.so |
@natxopedreira |
@ilyachur Sorry i can not close it, im not the original autor, @tgonzalez89 can you check and close it please? |
@tgonzalez89 I am closing the ticket because I didn't get a feedback from your side but @natxopedreira confirmed that his problem was resolved. Feel free to reopen this ticket if the solution doesn't work for you or you have any questions. |
[ INFO ] InferenceEngine: should I install another openvino toolkit version to test it? I installed this l_openvino_toolkit_runtime_raspbian_p_2021.2.185.tgz Thanks |
Hi there! I'm trying to rum my yolov5 demo on RPI, the same script I ran on CPU and works fine, but with RPI when I use this line: $python3 demo.py -m model.xml -d MYRIAD -i image.jpeg. |
OpenVINO 2020.1 simply refuses to work when using the NCS2 in a Raspberry Pi. I'm seeing the error below. I have tested multiple sample applications using both C++ and Python and all give the same error.
The text was updated successfully, but these errors were encountered: