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

Any idea how to convert trained custom detection model (yolov3_last.pt) to onnx format? #790

Open
Ebipatei opened this issue Jan 10, 2023 · 1 comment

Comments

@Ebipatei
Copy link
Contributor

Following the code below, it returns this error: AttributeError: 'collections.OrderedDict' object has no attribute 'training'

import torch
device = 'cuda:0' if torch.cuda.is_available else 'cpu'

load_saved_model = torch.load('labelled/models/yolov3_labelled_last.pt')

dummy_input = torch.FloatTensor(1,3,416,416)

dummy_input = dummy_input.to(device)

torch.onnx.export(load_saved_model, dummy_input, 'yolov3_labelled.onnx')

Any pointers will be appreciated.

@OlafenwaMoses
Copy link
Owner

@Ebipatei I will work on adding this functionality internally in ImageAI.

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

No branches or pull requests

2 participants