import torch import model myModel = model.ModelFactory.get_model('resnet', 'document') myModel.load_state_dict(torch.load('outputs/doc552023/doc_0505_0/doc_0505document_resnet.pth')) myModel.eval() dummy_input = torch.randn(1, 3, 32, 32) torch.onnx.export(myModel, dummy_input, "document_1.0.0.onnx", do_constant_folding=False)