Skip to content
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

Rund benchmark Openvino using RPI #8728

Closed
Guemann-ui opened this issue Nov 21, 2021 · 13 comments
Closed

Rund benchmark Openvino using RPI #8728

Guemann-ui opened this issue Nov 21, 2021 · 13 comments
Assignees
Labels
category: Python API OpenVINO Python bindings platform: arm OpenVINO on ARM / ARM64 support_request

Comments

@Guemann-ui
Copy link

Hi! I faced this problem when I ran the benchmark on RPI! any help?

[Step 3/11] Setting device configuration
[Step 4/11] Reading the Intermediate Representation network
[ ERROR ] Cannot create Swish layer Mul_2 id:5
Traceback (most recent call last):
  File "/opt/intel/openvino/python/python3.7/openvino/tools/benchmark/main.py", line 166, in run
    ie_network = benchmark.read_network(args.path_to_model)
  File "/opt/intel/openvino/python/python3.7/openvino/tools/benchmark/benchmark.py", line 67, in read_network
    ie_network = self.ie.read_network(xml_filename, bin_filename)
  File "ie_api.pyx", line 261, in openvino.inference_engine.ie_api.IECore.read_network
  File "ie_api.pyx", line 293, in openvino.inference_engine.ie_api.IECore.read_network
**RuntimeError: Cannot create Swish layer Mul_2 id:5**

@Iffa-Intel
Copy link

Hi,

which model are you using? and what topology is it? (eg: Model: Tensorflow, Topology:Inception v2)

@Iffa-Intel Iffa-Intel added category: Python API OpenVINO Python bindings platform: arm OpenVINO on ARM / ARM64 and removed bug Something isn't working labels Nov 22, 2021
@alalek
Copy link

alalek commented Nov 22, 2021

Do you have "CPU" plugin in the used RPi OpenVINO package? (check plugins.xml file)

If no, then it is special package which is targeted to support MYRIAD devices (like Intel NCS2 USB stick) only.

/cc @alvoron @vladimir-dudnik

@Guemann-ui
Copy link
Author

Hi, I used a YOLOv5 nanoarchitecture, the model works fine with the same Python scripts on my computer using MYRIAD and I tested it before on RPI! I don't know where this problem comes from.

@Iffa-Intel
Copy link

Iffa-Intel commented Nov 23, 2021

From what I can see your model, topology, and layer (Swish layer) is supported.
Did you create this custom layer or is it already been there in the YOLOV5 model since the last time it worked?
Usually, this swish activation function is used with Keras.

  • Note: the Swish/Sigmoid is actually an activation function implemented as a layer, so don't be surprised if I mention it as activation function instead of a layer ;-).

From here, it's said that the YOLOV5 is using Sigmoid activation function instead of Swish. (Correct me if yours is initially using Swish)

The Swish activation function is actually x times Sigmod function.

If you created it, I suggest you take a proper look at your code since that's the main thing your error is telling.

It would be great if you could provide these:

  1. your model and also the link to the YOLOV5 nanoarchitecture source (if possible)
  2. which version of OpenVINO you are using? build from source or installed from distribution?
  3. OS you are running on RPI4 (Raspbian/Ubuntu/etc)

@zzff-sys
Copy link

zzff-sys commented Nov 23, 2021

Hello! I ran into the same problem when I used Yolov5s and The PyTorch framework and ran the result on raspberry PI 4 and NCS2 as follows:
AX(ASSQ3EKI XZNJ@(L}LOB

@Iffa-Intel
Copy link

Iffa-Intel commented Nov 23, 2021

@zzff-sys ,

Similar to what I asked from @besmaGuesmi,

It would be great if you could provide these:

  1. your model and also the link to the YOLOV5 nanoarchitecture source (if possible)
  2. which version of OpenVINO you are using? build from source or installed from distribution?
  3. In your case, it's good if you could provide your conversion details.

@zzff-sys
Copy link

Hello! I have posted some instructions to my Github project, which can be accessed as follows:
https://github.com/zzff-sys/yolov5s_demo
thank you! @ @Iffa-Meah

@alalek
Copy link

alalek commented Nov 23, 2021

@zzff-sys

2020.3.2

This is old release. Please try the latest one (e.g., 2021.4.2).

Swish

Looks like VPU (MYRIAD) plugin brings support in 2021.1: #1612


(BTW, avoid posting text information through screenshots - it is ridiculous and blocks searching engines)

@Iffa-Intel
Copy link

Iffa-Intel commented Nov 23, 2021

Hi @zzff-sys @besmaGuesmi ,

I manage to run the YOLOV5 with the OpenVINO Benchmark App using Raspberry Pi 4 (8GB RAM)+NCS2 with OpenVINO 2021.4.1, newer version should works too.

run_benchmarkapp

run_benchmarkapp2

Please note that you'll need to properly build the Benchmark App.
These are the steps:

  1. cd to your build dir
  2. Insert your build dir location at the end: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" ~/Downloads/build
  3. make -j2 benchmark_app

You'll have the built binary in the arm dir (the same as object detection sample app)
PI_benchmarkapp_properbuild

Note that the OpenVINO Object Detection Sample SSD is not suitable to be run with YOLOV5 since it requires output to be 7 as a last dimension (which is not complement with the YOLOV5 model). This is why it fails. You may use the Benchmark App instead and work your way from there.

NOTsuitable_objDetectionSample

@zzff-sys
Copy link

@Iffa-Meah
Thank you very much for the detailed steps you provided. According to your steps, I have been able to successfully complete and have a deep understanding of the deployment process. Thank you very much!

@Guemann-ui
Copy link
Author

Hi @Iffa-Meah
I have downloaded OpenVINO20210.4 and I faced an error That openVINO is not found !! the problem is that I used this version with my script last time and worked fine! I don't understand what is the problem with the new versions!

@Iffa-Intel
Copy link

Iffa-Intel commented Nov 29, 2021

@besmaGuesmi if you faced the error of OpenVINO is not found, then definitely there's something you didn't set up properly.
Please help to follow the guide carefully.
The yolov5 with OpenVINO is proven to work from my side and also @zzff-sys side.

If you custom created that python script there's possibility that you need to update some code to the script or it could be something else.
It's good if you could share the script.

@Iffa-Intel
Copy link

Closing issue, feel free to re-open or start a new issue if additional assistance is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings platform: arm OpenVINO on ARM / ARM64 support_request
Projects
None yet
Development

No branches or pull requests

4 participants