CTracker icon indicating copy to clipboard operation
CTracker copied to clipboard

convert to onnx

Open LittleQQ opened this issue 4 years ago • 1 comments

i convert model to onnx with following code: device = 'cuda' if torch.cuda.is_available() else 'cpu' modelpath = './model_final.pt' model = torch.load(modelpath) model.to(device) model.eval() dummy_input = torch.randn(1, 3, 512, 512).to(device) onnx_path = './model_final.onnx' torch.onnx.export(model.module, dummy_input, onnx_path) it can convert successfully but i inference with onnx model ,it can't load onnx model ,how can solve it ?

LittleQQ avatar Aug 06 '21 08:08 LittleQQ

Maybe you can see if the absolute path and file name are wrong.

pjl1995 avatar Sep 06 '21 03:09 pjl1995