Closed chenscottus closed 8 months ago
I am not familiar with exporting to ONNX, but you can try the following code, which I found in another project: ''' pip install onnx import torch model = ... input_sample = torch.randn(1, 3, 256, 128) # Assuming input shape is (1, 3, 256, 128) onnx_file_path = "model.onnx" torch.onnx.export(model, input_sample, onnx_file_path, export_params=True) ''' ''' import onnxruntime onnx_session = onnxruntime.InferenceSession(onnx_file_path) input_data = ... output = onnx_session.run(None, {"input": input_data}) '''
Hello,
-Scott