c++backpropagationonnxruntime

Backpropagation on ONNX runtime


I want to implement backpropagation on ONNX model in C++. Here is the process, I trained the model in pytorch then exported it to ONNX. I import the model using ONNX runtime and now my goal is to implement backpropagation on this model that I imported. I am new to ONNX and tried to search on the internet but could not find anything helpful.

In simple words, I want to run the backpropagation on GPU.

I searched ONNX runtime documentation on training but it does not provide any information related to backpropagation.

I would be pleased if someone can provide some guidelines on this issue.


Solution

  • After searching sometime on the internet, I found one post on Github that gives me an idea about how I can update the weights on the ONNX model. Below is the link.

    https://github.com/onnx/onnx/issues/2978

    Get the weights from the ONNX model, provide input data, get prediction then implement backpropagation and calculate the updated weights at the end replace them save the model.