-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Custom model cannot export onnx from pt file #13126
Comments
👋 Hello @thinker310, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users. InstallPip install the pip install ultralytics EnvironmentsYOLOv8 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 Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
Hi there! 👋 It looks like you're encountering an issue with exporting your custom YOLOv8 model to ONNX. The error might be related to the new module you added. Here's a quick suggestion to help you troubleshoot:
If you continue to face issues, please share more details about the custom module or any specific operations it includes. This will help us provide more targeted assistance. Good luck, and feel free to reach out if you need further help! 😊 |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Search before asking
Question
I add a new moudule into YOLOv8 and trained it. The pretrained model was saved as a .pt file and I want to export it to .onnx file. But an IndexError happended as the picture showed below:
![image](https://private-user-images.githubusercontent.com/62609436/333817987-8f6fbf3d-b223-4c8f-9ebc-8aff2e87c675.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NDIxNTEsIm5iZiI6MTcyMDQ0MTg1MSwicGF0aCI6Ii82MjYwOTQzNi8zMzM4MTc5ODctOGY2ZmJmM2QtYjIyMy00YzhmLTllYmMtOGFmZjJlODdjNjc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDEyMzA1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlMzc1YzU0Y2FmNDVlYzNiMDk0MTg2NWQ2MDE1ZTkwNTM2ODljZmZkOThjMDVmNzcyMDMwMDk0YzU1OGZjZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5ZJP6L1tEBqjicBBkrMM1BHMCTJQIALMA0kQUEvEcGU)
the convert code as follows:
from ultralytics import YOLO
model=YOLO('./best.pt')
model.export(format='onnx',opset=17)
Additionally, I tried many arguments (opset=17,16,15... or imgsz=[640,640]) for exporting but it didnot work.
Could you help me? Thank you in advance!
Additional
No response
The text was updated successfully, but these errors were encountered: