TexasInstruments / edgeai-tidl-tools

Edgeai TIDL Tools and Examples - This repository contains Tools and example developed for Deep learning runtime (DLRT) offering provided by TI’s edge AI solutions.
Other
129 stars 33 forks source link

Compile pytorch model #2

Open Childhoo opened 2 years ago

Childhoo commented 2 years ago

I am compiling a onnx model to its compiled artifacts with the following command: python3 onnxrt_ep_mymodel.py -c (I did necessary setting for this model)

However, the model compiling does not succeed. The error message "Segmentation fault (core dumped)" is given. image

Two questions regarding this issue arise: 1) When the pytorch model is converted to onnx model, should a standard onnxruntime work or do we need to set the target CPU as "CPU-TIDL"? 2) Is there a limitation to the size of the input data of a model?

Thank you a lot for your attention and help!

kumardesappan commented 2 years ago

@Childhoo The onnx model is expected to work with both CPU only and TIDL EP. This is no limitation on input size.

Can you share the onnx model and onnxrt_ep_mymodel.py to reproduce this issue at our end?

Childhoo commented 2 years ago

@kumardesappan Thank you for your reply! To update my progress, I tried the ARM only mode by passing "-d" as an argument and it was successful.

Then I move to the step of adding operations to deny_list

'deny_list': "Unsqueeze, BatchNormalization, Constant, Add, Slice, Shape, Gather, GlobalAveragePool, AveragePool, Cast, Resize, Concat, ReduceMax, Sub, Exp, ReduceSum, Div, ArgMax",

and rerun

python3 onnxrt_ep_mymodel.py -c

it still gives the same segmentation fault (core dumped) error again.

Childhoo commented 2 years ago

@kumardesappan I provide four files for reproduce the above mentioned issue:

For repriduce the issues, please do the following steps: 1) copy "onnxrt_ep_mymodel.py" and "utils.py" to ./examples/osrt_python/ort 2) place the test image "Curb_test_512.png" under ./test_data 3) place the .onnx model file "psp-r50-512x512onnx" under ./models/public/onnx

And then run python onnxrt_ep_mymodel.py -c to reproduce the issue

As the file is too large to attach in this issue here, please access via google drive: https://drive.google.com/file/d/1d0CR48aKDbAg8QpI3ZCQ44O003jMocRp/view?usp=sharing

Thank you very much for your time and effort in advance! If you need any support for reproducing this issue, I am always glad to help.

guodaoyi commented 1 year ago

@kumardesappan I provide four files for reproduce the above mentioned issue:

  • "onnxrt_ep_mymodel.py" : the script for compling my onnx models "psp-r50-512x512onnx.onnx"
  • "utils.py": add information such as mean value and #classes for the new model
  • "Curb_test_512.png": test image
  • "psp-r50-512x512onnx.onnx": the input .onnx file

For repriduce the issues, please do the following steps:

  1. copy "onnxrt_ep_mymodel.py" and "utils.py" to ./examples/osrt_python/ort
  2. place the test image "Curb_test_512.png" under ./test_data
  3. place the .onnx model file "psp-r50-512x512onnx" under ./models/public/onnx

And then run python onnxrt_ep_mymodel.py -c to reproduce the issue

As the file is too large to attach in this issue here, please access via google drive: https://drive.google.com/file/d/1d0CR48aKDbAg8QpI3ZCQ44O003jMocRp/view?usp=sharing

Thank you very much for your time and effort in advance! If you need any support for reproducing this issue, I am always glad to help.

hello,I have encountered the same problem as you. Have you resolved this problem,please.