I wold be grateful to any example/tutorial showing a succesful onnx exportation of a DeepLabv3+ model. I fail to export a transfer trained model and I have so far been unsuccesful to find any good example showing this.
What I have tried is:
#Saving my transfer learnt model
torch.save(trained_model.state_dict() ,os.path.join(mypath,‘weights1.pt’))
#Attemp to load and export :
device = torch.device(‘cpu’)
model = models.segmentation.deeplabv3_resnet101(
pretrained=True, progress=True)
model.classifier = models.segmentation.deeplabv3.DeepLabHead(2048, 1)
model.load_state_dict(torch.load(‘weights1.pt’, map_location=device))
model.eval()
dummy_input = torch.randn(1, 3, 224, 224)
torch.onnx.export(model, dummy_input, “outmodel.onnx”)
I keep getting this error message:
RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got collections.OrderedDict
Thanks,