I was wondering if anyone has any ideas for how to export to disk a trained model in libtorch, then load in python pytorch? The environment I work in benefits from training in the C++ runtime, but it is often nice to run visualizations on the python end for insights.
I’ve seen this here but there doesn’t seem to me much options: Exporting libtorch model and loading in Python
Ideally, the loading side on the python pytorch can be done with vanilla pytorch (no C++ extensions). Maybe a custom script which reads the weights from the exported file and sets the weights accordingly on the python end, assuming the network structure is the same and the weights are written in a deterministic way? Are there any documentation for how the weights are stored in the exported file? Any other ideas?