pulp-platform / dory

A tool to deploy Deep Neural Networks on PULP-based SoC's
Apache License 2.0
72 stars 22 forks source link

`05_DORY_Frontend_final_graph.onn` seem to be the same as `Original_graph.onnx` #41

Closed chengliu-LR closed 1 year ago

chengliu-LR commented 1 year ago

Dear dory developers,

I am using dory to generate my own dronet-network, which is an integer-quantized onnx file generated by nemo (master branch). However, while dory could deal with dory_examples like dronet_complete very well, it can not process my own network. I keep receiving the following issue: DORY Frontend Check. Node Add is not accepted inside the DORY Frontend IR.. If I look inside the log folder, I found that the automatically generated05_DORY_Frontend_final_graph.onnx is the same as Original_graph.onnx. Any insights on the possible reasons of this problem? Thank you for your time!

ABurrello commented 1 year ago

Hello, DORY works by recognizing patterns inside input graphs. The error you have, means that the Add node has not been wrapped inside the DORY-Add, since it miss the pattern that it needs. You can check files that contain patterns in the different frontends

chengliu-LR commented 1 year ago

Hello, DORY works by recognizing patterns inside input graphs. The error you have, means that the Add node has not been wrapped inside the DORY-Add, since it miss the pattern that it needs. You can check files that contain patterns in the different frontends

Hi,

Thank you for your reply & help! After rewriting my PyTorch model and quantization by nemo, I made dory work with my own neural network model. However, I am still wondering:

  1. When I run my model on gvsoc, how the inputs are generated and connected with the network? I can see many .hex files, are these files related to the gvsoc simulation?
  2. The next step of my work would be applying it on AI-Deck where a GAP8 is connected with a 224x320 gray-scale camera, I want to connect the network with real-time camera images. What should I do to modify the generated C code to pass camera images as inputs to the network?
  3. There are other popular quantization toolboxes like AIMET which can also output quantized ONNX graphs, does dory also support other quantization models like AIMET?

I would really appreciate it if you could help me with answering these questions! Thank you!

hanyax commented 1 year ago

Hi, I am facing the same issue. I am wondering how did you rewrite your PyTorch model to solve it? @chengliu-LR

ABurrello commented 1 year ago

You have to use either quantlab or Nemo frontend. Both have the possibility to export networks to be ingested by DORY. Note that there are many examples in https://github.com/pulp-platform/dory_examples . You can check it to understand how the graph should look like.