model = models.segmentation.deeplabv3_resnet101(pretrained=True)
model.eval()
print(model)
torch.save(model, “deeplabv3_resnet101.pth”)
dummy_input = torch.randn(1, 3, 224, 224)
input_names = [“actual_input_1”] + [“learned_%d” % i for i in range(16)]
torch.onnx.export(model,
dummy_input,
“deeplabv3_resnet101.onnx”,
verbose=True,
input_names=input_names,
opset_version=11,
)
deeplabv3_resnet101.onnx, have two outputs: “1094” “1078”