-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
Export TensorRT engine - Device memory is insufficient to use tactic. - NX2 TX Jetson Platform. #12637
Comments
👋 Hello @nicorl, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. 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. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install 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 currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@nicorl hello! Thanks for the detailed issue report. It seems like you're encountering out-of-memory (OOM) errors when exporting your model to TensorRT on the Jetson TX2 NX platform. Here are a few suggestions that might help:
If these suggestions don't resolve the issue, consider posting the full error log and your export command in the issue for further assistance. Remember to check the Ultralytics Docs for more information on exporting models and troubleshooting. Keep in mind that the Jetson TX2 NX has limited memory, and some models may simply be too large to run efficiently on this platform. You might need to consider a more powerful device if memory constraints continue to be an issue. Thanks for contributing to the YOLOv5 community, and we appreciate your efforts in making the model work on edge devices! 🚀 |
Hi again,
But ultimately, generating the TensorRT 8.2 wheel has posed issues for which I cannot find any solution. Below, I provide all the executed commands as information for anyone reading this message. It's worth noting that the next steps will involve trying to use Python version 3.8 and the rest of the software in appropriate versions. As I make significant progress, I will leave further comments. Nvidia forum link where someone is helping to solve this |
Hello again @nicorl, It sounds like you're making progress, but still encountering some challenges with the TensorRT wheel installation. Here are a few general tips that might help:
Remember to take it one step at a time and isolate each issue as you encounter it. Building complex software from source can be challenging, but with persistence, you'll likely find a solution. Keep up the good work, and thank you for keeping the community updated on your progress! 🛠️ Best of luck with the next steps, and we're looking forward to hearing about your successful export with the updated Python version and software stack. |
👋 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
YOLOv5 Component
No response
Bug
I have trained a PyTorch model (.pb) and I am looking to optimize it to consume less memory. The attempts to export it to TensorRT are causing issues because the device has limited available memory, and I'm unsure how to achieve a proper export.
Trained through:
Loading model on memory:
Virtual environment with: Python 3.6.9, torch-1.8.0
→ The pytorch model (best.pt) requires approximately ~1.2GB of memory
→ The model's performance is good ✓ (best.pt)
Exporting to TensorRT over Jetson TX2 NX with Python 3.6.9, torch-1.8.0, TensorRT 8.0.1.6, ONNX 1.11.0
Export command:
Errors & warning:
Full log here
The model.engine file is generated, but when i load it, the performance is not good:
On my PC with a larger amount of memory and Python v.3.10, the export process does not yield any warnings and works well. Because I can’t increase the memory of my TX2 NX, I would like to understand how relevant the warnings are and what would be the best way to avoid them. I believe upgrading to Python 3.7 is one option, but I would like to know if there are possibilities to make it works on 3.6.9
I've also put a link in the Nvidia forums, but I think it's more appropriate here than there.
Environment
TensorRT Version: 8.0.1.6
GPU Type: NVIDIA® Jetson™ TX2 NX - 4 Core ARM A57 Complex and 2 core NVIDIA Denver2 64-bit CPU - 4GB LPDDR4 - NVIDIA Tegra X2, 3832MiB
Nvidia Driver Version: nvidia-smi not installed
CUDA Version: cuda_10.2_r440.TC440_70.29663091_0
Operating System + Version: Linux aaeon-desktop 4.9.253-tegra SMP PREEMPT Mon Jul 26 12:19:28 PDT 2021 aarch64 GNU/Linux
Python Version: 3.6.9
PyTorch Version: 1.8.0
ONNX Version: 1.11.0
yolov5 Version: 6.2.1
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: