How can I convert onnx format to ptl format?
Here I already got my .onnx format file: retinaface.onnx, I want to convert it to PyTorch mobile supported format: .ptl or .pt, then I can do inference in Android platform. But I failed to convert or to find relevant issues.
// I want to load directly but failed
mRetinafaceDector =  LiteModuleLoader.load(mModelPath + &quot;/retinaface.onnx&quot;);

Seems the LiteModuleLoader.load() can only load .ptl or .pt, but in my hand I only have retinaface.onnx format..

You can't load onnx model directly to pytorch as it's not supported yet.
Fortunately you can use onnx2pytorch tool to convert onnx to pytorch
Firstly install it:
https://github.com/ToriML/onnx2pytorch
Then you can easily convert it using this code:
onnx_model = onnx.load(path_to_onnx_model)
pytorch_model = ConvertModel(onnx_model)

nevertheless, check this issue, it's about importing onnx directly in pytorch:
https://github.com/pytorch/pytorch/issues/21683
