-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
About converting .pt to .onnx #1407
Comments
@leeyunhome your error is not reproducible. Code exports to ONNX correctly. I've provided you our default response below. Hello, thank you for your interest in our work! This issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:
$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you! RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu. |
Hello, I'm following below. $ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest CODE TO REPRODUCE YOUR ISSUE HERE================================================================= Downloading https://github.com/ultralytics/yolov5/releases/download/v3.1/yolov5s.pt to yolov5s.pt... Fusing layers...
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
i got this error from scipy.linalg import _fblas: ImportError: DLL load failed: The specified module could not be found |
@erolgerceker you may want to raise this issue directly on the scipy repo. |
thank you. |
@leeyunhome you're welcome! If you have any more questions, feel free to ask. |
❔Question
Hello,
Following the guide, I tried to convert the .pt file to .onnx with the following command,
but I got the following error. Can I see what's wrong?
And can I ignore the warning in the middle?
python3 models/export.py --weights weights/last.pt --img 640 --batch 1
Namespace(batch_size=1, img_size=[640, 640], weights='weights/last.pt')
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'models.yolo.Model' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'models.common.Focus' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'models.common.Conv' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.activation.LeakyReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'models.common.BottleneckCSP' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.ModuleList' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.upsampling.Upsample' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/hongildong/.local/lib/python3.6/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'models.yolo.Detect' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
Fusing layers...
Model Summary: 231 layers, 7521612 parameters, 0 gradients
Traceback (most recent call last):
File "models/export.py", line 51, in
y = model(img) # dry run
File "/home/hongildong/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "./models/yolo.py", line 121, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "./models/yolo.py", line 137, in forward_once
x = m(x) # run
File "/home/hongildong/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "./models/yolo.py", line 48, in forward
x[i] = self.mi # conv
File "/home/hongildong/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 779, in getattr
type(self).name, name))
torch.nn.modules.module.ModuleAttributeError: 'Detect' object has no attribute 'm'
Thank you.
Additional context
The text was updated successfully, but these errors were encountered: