Ok about @torch.jit.script_method, it seems that documentation wasn’t up to date here and there, so that’s why I was confused with torchscript, sometimes modules needed to inherit from torch.jit.ScriptModule, sometimes not, I thought this was y a typo…
So here, I’ve learned that starting from 1.2, no need to inherit from ScriptModule but use torch.jit.script( model ) instead.
https://pytorch.org/docs/stable/jit.html#migrating-to-pytorch-1-2-recursive-scripting-api 22
So maybe I should, in C++:
-update my Pytorch version (I’m using 1.1.0)
-load my trained model .pt
-use torch::jit::script() on it
-save it
-retry the Python conversion script to onnx
I hope this does not require I restart my training, and that I can use my .pt as is.
What do you think ? (I’m still open for answers to my other question to better understand how model I/O work.
Thanks.
Edit: Ok I guess it’s not the way it works, I cannot find torch::jit::script() in C++.