jwyang / faster-rcnn.pytorch

A faster pytorch implementation of faster r-cnn
MIT License
7.67k stars 2.33k forks source link

torch.onnx #768

Open LeonNerd opened 4 years ago

LeonNerd commented 4 years ago

I want to convert PTH to onnx, what should I do.torch.onnx need to import the network model and weights.But I don't know what a network model it is

xingshuohan commented 4 years ago

I have the same issue

loolzaaa commented 4 years ago

But I don't know what a network model it is

Try to look in this tutorial.

The model is the complex of nn.Module layers. Weights usually save in state_dict() collection, so you need to create/load model architecture and load its state_dict with weights. After that, export to ONNX.

xingshuohan commented 4 years ago

could you please share the code for converting it to onnx format?