Replies: 3 comments
-
Thanks @washraf, can you provide a PyTorch example with shared modules that cannot be exported into ONNX as expected? |
Beta Was this translation helpful? Give feedback.
-
Hello @liqunfu, I don't have an issue in the conversion of PyTorch models. My goal is to combine two onnx models that share most of their layers into one model. The reference of both Keras and PyTorch is to show that the concept is doable in other formats. For example, assume I have two instances of ResNet and they share the same layers from 1 to k, and the rest of the layers each onnx model have its own layers. I want to combine the first layers, to gain many advantages in computation time. |
Beta Was this translation helpful? Give feedback.
-
Please see if you can start with using this: https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md#creating-an-onnx-model-using-helper-functions. Essentially you need to create a "new" model - but you should be able to load both the models and try and connect the layers by using the exposed ONNX APIs. |
Beta Was this translation helpful? Give feedback.
-
Ask a Question
I want to merge layers of two models that share the first k layers.
Question
I want to merge/combine two models as shown in the image below. This merging has a lot of benefits in terms of computation time.
This technique is available in almost all deep learning frameworks such as in Pytorch and Keras.
Further information
Relevant Area (e.g. model usage, backend, best practices, converters, shape_inference, version_converter, training, test, operators):
Is this issue related to a specific model?
Model name (e.g. mnist):
Model opset (e.g. 7):
Notes
Any additional information, code snippets.
Beta Was this translation helpful? Give feedback.
All reactions