A set of simple tools for splitting, merging, OP deletion, size compression, rewriting attributes and constants, OP generation, change opset, change to the specified input order, addition of OP, RGB to BGR conversion, change batch size, batch rename of OP, and JSON convertion for ONNX models.
A set of simple tools for splitting, merging, OP deletion, size compression, rewriting attributes and constants, OP generation, change opset, change to the specified input order, addition of OP, RGB to BGR conversion, change batch size, batch rename of OP, and JSON convertion for ONNX models.
1. Tools
HostPC
# (1) Minimum configuration installation with no dependent packages installed
$ pip install -U simple-onnx-processing-tools \
&& pip install -U onnx \
&& python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com
or
# (2) When installing all dependent packages such as onnx-simplifier, onnxruntime, numpy, etc...
$ pip install -U simple-onnx-processing-tools[full] \
&& pip install -U onnx \
&& python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com
A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want. Simple Network Extraction for ONNX.
A very simple tool that compresses the overall size of the ONNX model by aggregating duplicate constant values as much as possible. Simple Constant value Shrink for ONNX.
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.
Simple ONNX constant encoder/decoder. Since the constant values in the JSON files generated by onnx2json are Base64-encoded values, ASCII <-> Base64 conversion is required when rewriting JSON constant values.
Checker with simple ONNX model structure. Simple Structure Checker for ONNX. Analyzes and displays the structure of huge size models that cannot be displayed by Netron.
Self-Created Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf).
Simple tool for partial optimization of ONNX. Further optimize some models that cannot be optimized with onnx-optimizer and onnxsim by several tens of percent. In particular, models containing Einsum and OneHot.
ONNX Simplifier is presented to simplify the ONNX model. It infers the whole computation graph and then replaces the redundant operators with their constant outputs.
Easy-to-use UI for automatically sparsifying neural networks and creating sparsification recipes for better inference performance and a smaller footprint.
Sparsebit is a toolkit with pruning and quantization capabilities. It is designed to help researchers compress and accelerate neural network models by modifying only a few codes in existing pytorch project.
--connection_dest_op_input_names ADDOP_NAME ADDOP_OUTPUT_NAME DESTOP_NAME DESTOP_INPUT_NAME
Specify the name of the input name from which to connect.
e.g.
-Before-
[OpA]oname1 - iname1[OpB]oname1
[OpC]oname1
-After-
[OpA]oname1 - iname1[AddOP1]oname1 - iname1[OpB]oname1
[OpC]oname1 - iname2[AddOP1]
When extrapolating a new OP between OpA and OpB.
--connection_dest_op_input_names AddOP1 oname1 OpB iname1
When I want to add a new OP after [Opc]onname1,how should this parameter be set?
That is to say, if I want to add a new node after the "output" node, how should this parameter be set?
Hi PINTO0309,
Thanks for your work, first.
I have two question to query
1.I found if we change the INPUT BATCH size as 8, the OUTPUT BATCH size also will change to 8
the command as below (base) joyoki@joyoki:~/fast-bev$ sbi4onnx -if fast-bev_orig.onnx -of fast-bev_orig_bat ch8.onnx -ics 8
i think this is not right, could you help double check, if we could change INPUT batch size and OUTPUT batch size Separated by need, such as sbi4onnx -if fast-bev_simply.onnx -ics 8 -of fast-bev_simply_batch6.onnx -ics 1
I tried to use scc4onnx to change the input and output shape from NHWC to NCHW of this ONNX file.
However, I was only able to change the input shape and not the output shape. I was wondering if you can help me change both input and output nodes shape to be in NCHW format.
Hello, thank you for your nice work, I tried your project yolact_edge_onnx_tensorrt_myriad and convert the orignal yolact_edge_54_800000.pth to onnx, when using the onnx for detecting, the onnx out four values, and the model structure is not the same as your example, could you please tell me what is the problem with my operation, thank you very much.
Look forworing your reply