Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how convert the ts output to onnx? #10

Open
MECHAAMER opened this issue Nov 21, 2024 · 0 comments
Open

how convert the ts output to onnx? #10

MECHAAMER opened this issue Nov 21, 2024 · 0 comments

Comments

@MECHAAMER
Copy link

can you guide me how convert the tx output to onnx?

I try this:

import torch
import onnx
import torchvision

model = torch.jit.load("/....../weights/best.ts")

# Set  input shape of the model
 input_shape = (1, 3, 224, 224)
 ​
 # Export  PyTorch model to ONNX format
 torch.onnx.export(model, torch.randn(input_shape), 'output.onnx')


this is the output:

Inputs:
     #0: r0 defined in (%r0 : Tensor = prim::TupleConstruct(%388, %386, %387), scope: nets.nn.QAT:: # /home/at-am/.local/lib/python3.8/site-packages/torch/ao/nn/quantized/modules/functional_modules.py:212:12
 )  (type 'Tensor')
     #1: 405 defined in (%405 : Tensor = onnx::Concat[axis=0](%402, %404), scope: nets.nn.QAT:: # /home/at-am/datasets/VisDrone/Yolo-qat/nets/nn.py:50:17
 )  (type 'Tensor')
 Outputs:
     #0: 406 defined in (%406 : Tensor[] = onnx::SplitToSequence[axis=1](%r0, %405), scope: nets.nn.QAT:: # /home/at-am/datasets/VisDrone/Yolo-qat/nets/nn.py:50:17
 )  (type 'List[Tensor]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant