Comments (6)
👋 Hello @MrYanMYN, 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.
Install
Pip install the ultralytics
package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.
pip install ultralytics
Environments
YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
If 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.
from ultralytics.
Hello @MrYanMYN,
Thank you for reporting this issue and providing detailed information. It looks like you're encountering an error when loading and using the TensorRT version of the YOLOv8 model on your Jetson Orin AGX.
To help us investigate this further, could you please confirm the following:
-
Reproducible Code Example: The provided code snippet is helpful, but we need a minimal reproducible example that we can run to replicate the issue. Please refer to our Minimum Reproducible Example guide for more details on how to structure this.
-
Package Versions: Ensure you are using the latest versions of
torch
andultralytics
. You can update your packages using:pip install --upgrade torch ultralytics
-
Model Export and Inference: Verify that the model export and inference steps are correctly implemented. Here is a concise example for exporting and loading a TensorRT model:
from ultralytics import YOLO # Load the YOLOv8 model model = YOLO("yolov8n.pt") # Export the model to TensorRT format model.export(format="engine") # creates 'yolov8n.engine' # Load the exported TensorRT model tensorrt_model = YOLO("yolov8n.engine") # Run inference results = tensorrt_model("https://ultralytics.com/images/bus.jpg")
If the issue persists after ensuring the above steps, please provide the updated code and any additional error messages you encounter. This will help us diagnose and resolve the problem more effectively.
Looking forward to your response!
from ultralytics.
So the minimal amount of code for reproduction of the issue is just the normal snippet your provided for export and inference.
For some reason even when running it purely alone I get the same error
from ultralytics.
Hello @MrYanMYN,
Thank you for your prompt response and for confirming that the issue persists with the minimal code snippet provided.
To help us investigate further, could you please ensure the following:
-
Minimum Reproducible Example: Please provide a minimal reproducible example that we can run to replicate the issue. This is crucial for us to diagnose the problem effectively. You can refer to our Minimum Reproducible Example guide for more details.
-
Package Versions: Make sure you are using the latest versions of
torch
andultralytics
. You can update your packages using:pip install --upgrade torch ultralytics
-
Model Export and Inference: Verify that the model export and inference steps are correctly implemented. Here is a concise example for exporting and loading a TensorRT model:
from ultralytics import YOLO # Load the YOLOv8 model model = YOLO("yolov8n.pt") # Export the model to TensorRT format model.export(format="engine") # creates 'yolov8n.engine' # Load the exported TensorRT model tensorrt_model = YOLO("yolov8n.engine") # Run inference results = tensorrt_model("https://ultralytics.com/images/bus.jpg")
If the issue persists after ensuring the above steps, please provide the updated code and any additional error messages you encounter. This will help us diagnose and resolve the problem more effectively.
Looking forward to your response! 😊
from ultralytics.
Hey , as I said. I am running the most up to date version of torch and ultralytics while using the provided minimum viable code on a Jetson Orin AGX.
from ultralytics.
Hello @MrYanMYN,
Thank you for confirming that you're using the latest versions of torch
and ultralytics
and for providing the minimal code example. Given that the issue persists, let's delve a bit deeper.
It appears that the error might be related to the TensorRT model handling on the Jetson Orin AGX. Here are a few steps to help troubleshoot and potentially resolve the issue:
-
TensorRT Version: Ensure that the TensorRT version installed on your Jetson Orin AGX is compatible with the versions of
torch
andultralytics
you are using. Sometimes, mismatched versions can cause unexpected behavior. -
Model Export Verification: Double-check the export process to ensure the model is correctly exported to TensorRT format. You can try running the export and inference on a different machine with an NVIDIA GPU to see if the issue is specific to the Jetson Orin AGX.
-
Debugging Tensor Shapes: The error message indicates a tensor shape mismatch. You can add some debug prints to check the shapes of the tensors at different stages of the inference process. This might help pinpoint where the shape mismatch occurs.
Here's an example of how you might add debug prints:
from ultralytics import YOLO
# Load the YOLOv8 model
model = YOLO("yolov8n.pt")
# Export the model to TensorRT format
model.export(format="engine") # creates 'yolov8n.engine'
# Load the exported TensorRT model
tensorrt_model = YOLO("yolov8n.engine")
# Run inference with debug prints
image = "https://ultralytics.com/images/bus.jpg"
results = tensorrt_model(image)
print("Inference results:", results)
- Ultralytics Documentation: For additional guidance, you can refer to the Ultralytics TensorRT Integration Guide.
If the issue persists, please provide any additional error messages or observations you encounter. This will help us assist you more effectively.
Thank you for your patience and cooperation! 😊
from ultralytics.
Related Issues (20)
- When training in google colab environment, it won't show the precision as well as recall, mAP during training process. HOT 1
- Does not see several A2 video cards HOT 7
- Normalize in Detect Training HOT 3
- When will it be online to train its own target tracking dataset? HOT 1
- INT8 calibration set clarification HOT 1
- Label is not detecting HOT 4
- Implementing Custom Transfer learning HOT 16
- Multi GPU training error HOT 1
- gradio interface cannot play a detected video HOT 3
- yolov8 trt exporting question HOT 2
- tensorRT export type question HOT 5
- Why do GPU_mem, parameters, GFLOPs of YOLOv8 vary depending on the datasets? HOT 3
- Need Help: YOLO Model Predicts Zero Objects After Training (Beginner) HOT 4
- yolov8n onnx model outputs [1, 84, 8400 ] when using with onnxruntime HOT 10
- to combine 2 models with different classes with transfer learning HOT 7
- model track always after detect, can i detect once and just use tracker to get next frames boxes? HOT 4
- How would I go converting the model to tfjs HOT 6
- yolov8-redetr HOT 4
- Which epoch is best.pt? HOT 6
- Yolo V8 tflite conversion HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.