dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.91k stars 1.86k forks source link

Loading a LSTM Model Created in Torchsharp in ML.Net #7163

Open aforoughi1 opened 1 month ago

aforoughi1 commented 1 month ago

I can create/train/evaluate/save/load a multilayer LSTM model using Torchsharp but cannot run in ML.NET.

The main requirement is to export/import a Torchsharp model to ONNX and run it in ML.NET. However, Torchsharp doesn't implement torch.onnx.export method. I'm stuck at a point and had to convert everything to pytorch just to export to ONNX.

I also tried a custom pipeline and trial runner to train and evaluate the model but I'm struggling with how these models can be saved/Loaded in ML.NET.