edgeai-tidl-tools
edgeai-tidl-tools copied to clipboard
Compile pytorch model
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.
Two questions regarding this issue arise:
- 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"?
- Is there a limitation to the size of the input data of a model?
Thank you a lot for your attention and help!
@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?
@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.
@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:
- copy "onnxrt_ep_mymodel.py" and "utils.py" to ./examples/osrt_python/ort
- place the test image "Curb_test_512.png" under ./test_data
- 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.
@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:
- copy "onnxrt_ep_mymodel.py" and "utils.py" to ./examples/osrt_python/ort
- place the test image "Curb_test_512.png" under ./test_data
- place the .onnx model file "psp-r50-512x512onnx" under ./models/public/onnx
And then run
python onnxrt_ep_mymodel.py -c
to reproduce the issueAs 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.