Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
189 Views

raspberryPi 4B using openvino2020.2.120 sample make error and import openvino error

Jump to solution

My environment:

raspberryPi 4B

Movidius™ Neural Compute Stick or Intel® Neural Compute Stick 2.

python3.7、python2.7

l_openvino_toolkit_runtime_raspbian_p_2020.2.120.tgz

tensorflow1.12.0

cmake3.13.4

 

 

I downloaded and installed openvino as directed:Install OpenVINO™ toolkit for Raspbian* OS

When I execute the command:cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples

error occured:

pi@raspberrypi:~/myProj/build $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples
CMake Error: The source directory "/opt/intel/openvino/deployment_tools/inference_engine/samples" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

 

and /opt/intel/openvino/deployment_tools/inference_engine/samples does not exist CMakeLists.txt.

 

then I didn't continue to make the samples while the former comand I had successfully running.

 

And I plug in  Intel® Movidius™ Neural Compute Stick or Intel® Neural Compute Stick 2. Try to run the .py file exmple " Run Inference of Face Detection Model Using OpenCV* API":

Create a new Python* file named as openvino_fd_myriad.py and copy the following script there:

import cv2 as cv
 
# Load the model.
net = cv.dnn_DetectionModel('face-detection-adas-0001.xml',
'face-detection-adas-0001.bin')
# Specify target device.
net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)
 
# Read an image.
frame = cv.imread('/path/to/image')
if frame is None:
raise Exception('Image not found!')
 
# Perform an inference.
_, confidences, boxes = net.detect(frame, confThreshold=0.5)
 
# Draw detected faces on the frame.
for confidence, box in zip(list(confidences), boxes):
cv.rectangle(frame, box, color=(0, 255, 0))
 
# Save the frame to an image file.
cv.imwrite('out.png', frame)
 
 
and following error occured:

pi@raspberrypi:~/myProj/20200724tiredetc-vino/test $ python3 openvino_fd_myriad.py
terminate called after throwing an instance of 'InferenceEngine::details::InferenceEngineException'
what(): conv4_3_0_norm_mbox_priorbox/naked_not_unsqueezed has zero dimension that is not allowable
已放弃

 

Then I try to run the py file which download from github:

here are the begin of the .py file:

import sys, os, cv2, time, heapq, argparse
import numpy as np, math
try:
from armv7l.openvino.inference_engine import IENetwork, IEPlugin
except:
from openvino.inference_engine import IENetwork, IEPlugin
import multiprocessing as mp
from time import sleep
import threading

yolo_scale_13 = 13
yolo_scale_26 = 26
yolo_scale_52 = 52

classes = 80
coords = 4
num = 3
anchors = [10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326]

LABELS = ("person", "bicycle", "car", "motorbike", "aeroplane",
"bus", "train", "truck", "boat", "traffic light",
"fire hydrant", "stop sign", "parking meter", "bench", "bird",
"cat", "dog", "horse", "sheep", "cow","elephant", "bear", "zebra", "giraffe", "backpack",
"umbrella", "handbag", "tie", "suitcase", "frisbee",
"skis", "snowboard", "sports ball", "kite", "baseball bat",
"baseball glove", "skateboard", "surfboard","tennis racket", "bottle",
"wine glass", "cup", "fork", "knife", "spoon",
"bowl", "banana", "apple", "sandwich", "orange",
"broccoli", "carrot", "hot dog", "pizza", "donut",
"cake", "chair", "sofa", "pottedplant", "bed",
"diningtable", "toilet", "tvmonitor", "laptop", "mouse",
"remote", "keyboard", "cell phone", "microwave", "oven",
"toaster", "sink", "refrigerator", "book", "clock",
"vase", "scissors", "teddy bear", "hair drier", "toothbrush")

label_text_color = (255, 255, 255)
label_background_color = (125, 175, 75)
box_color = (255, 128, 0)
box_thickness = 1

processes = []

fps = ""
detectfps = ""
framecount = 0
detectframecount = 0
time1 = 0
time2 = 0

 

And the following error occured:

pi@raspberrypi:~/myProj/20200724tiredetc-vino/fromgit/OpenVINO-YoloV3 $ python3 openvino_tiny-yolov3_MultiStick_test.py
Traceback (most recent call last):
File "openvino_tiny-yolov3_MultiStick_test.py", line 8, in <module>
from armv7l.openvino.inference_engine import IENetwork, IEPlugin
ModuleNotFoundError: No module named 'armv7l'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "openvino_tiny-yolov3_MultiStick_test.py", line 10, in <module>
from openvino.inference_engine import IENetwork, IEPlugin
File "/opt/intel/openvino/python/python3.5/openvino/inference_engine/__init__.py", line 1, in <module>
from .ie_api import *
ImportError: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

 

Is that means I have to use python3.5? Or I didnt build the openvino right? But how to build it without makefile ? 

In addition I use openvino toolkit 2019.3.334 can success make the sample and run the  openvino_fd_myriad.py  with the same environment.

 

please help me to solve this problem!

 

0 Kudos

Accepted Solutions
Highlighted
169 Views

Hi JasmyChen,


Thanks for reaching out.


You cannot run the CMake command because the path is incomplete. If you go through that path, you will find three different directories inside of the /sample directory (C, CPP, and Python). To run the CMake command successfully, you just need to change the path like this:


cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples/cpp


Also, you need to use IRv7 format files (models from open model zoo 2019 R3 version) because there is an incompatibility issue between OpenVINO™ Toolkit 2020.2 for Raspbian OS and IRv10 format files (models from OpenVINO™ Toolkit 2020 version). Please, try running the openvino_fd_myriad.py again using IRv7 files from open model zoo 2019R3.


Let us know if the issue persists.


Regards,


Javier A.


View solution in original post

0 Kudos
4 Replies
Highlighted
170 Views

Hi JasmyChen,


Thanks for reaching out.


You cannot run the CMake command because the path is incomplete. If you go through that path, you will find three different directories inside of the /sample directory (C, CPP, and Python). To run the CMake command successfully, you just need to change the path like this:


cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples/cpp


Also, you need to use IRv7 format files (models from open model zoo 2019 R3 version) because there is an incompatibility issue between OpenVINO™ Toolkit 2020.2 for Raspbian OS and IRv10 format files (models from OpenVINO™ Toolkit 2020 version). Please, try running the openvino_fd_myriad.py again using IRv7 files from open model zoo 2019R3.


Let us know if the issue persists.


Regards,


Javier A.


View solution in original post

0 Kudos
Highlighted
Beginner
160 Views

Thank you for your answer!

I solved the above problem successfully according to your solution.

However, you mentioned "incompatibility issues between the OpenVINO™Toolkit 2020.2 for Raspbian OS and IRv10 format files".
That is, if I want to convert a .pb file to an IR file and then use the IR file with NCS2 to speed up the neural network on the Raspberry PI 4B, Then I won't be able to use the OpenVINO™Toolkit 2020 * model optimizer?

Then I have the following question, please read this "Linux openvino2019R3 conversion Yolov3-Tiny fails"

Thanks soooooo much!!!!!

Regards,

JasmyChen.

 

0 Kudos
Highlighted
142 Views

Hi Jasmychen,

 

We are glad that we help you to solve your issue.

 

If you use the model optimizer from OpenVINO™Toolkit 2020 versions to convert a .pb file to IR format, you will get IRv10 files which are not compatible with OpenVINO™Toolkit 2020.2 version for Raspbian OS.


This incompatibility issue has been solved in the latest release of OpenVINO™Toolkit (2020.4). Make sure to use the models from Open Model Zoo 2020.4 with OpenVINO™Toolkit 2020.4.


Your other question has been answered in the other thread. Since it is not related to this issue, we will keep supporting you there.

 

 

Regards,

 

Javier A.


0 Kudos
Highlighted
117 Views

Hi Jasmychen,


We will be closing this thread since we have provided a solution. If you need any additional information, please submit a new question as this thread is no longer being monitored.


Regards,


Javier A.



0 Kudos