Comments (7)
I encountered a similar error when trying to run YOLOv8 from the official repository:
from ultralytics import YOLO
import cv2
import torch
# torch.backends.cudnn.benchmark = True
# torch.backends.cudnn.enabled=False
# torch.backends.cudnn.deterministic = True
# Load a model
model = YOLO("yolov5su.pt") # load a pretrained model (recommended for training)
im2 = cv2.imread("test.png")
results = model.predict(source=im2, conf=0.1, half=True, classes=[0])
The fix for me was to run it on benchmark mode OR disabling cudnn (as in the commented out lines). Hope this helps! Credits to ptrblack from official Torch forums
from ultralytics.
@gerrylwk thanks for the solution. I faced a similar issue, but it was solved when I used
`from ultralytics import YOLO
import cv2
import torch
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = True
model = YOLO("yolov5su.pt") # load a pretrained model (recommended for training)
im2 = cv2.imread("test.png")
results = model.predict(source=im2, conf=0.1, half=True, classes=[0])`
It was on NVIDIA-RTX 3050 GPU. It seems to be a viable solution.
from ultralytics.
I added only the lines :
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = True
and the warning disappeared. I was tuning resnet50 on NVIDIA-RTX 3050
from ultralytics.
π Hello @Kaspso, 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! It seems you're encountering some issues with cuDNN when using YOLOv8 for keypoint detection. The CUDNN_STATUS_NOT_SUPPORTED
warning sometimes indicates a compatibility issue between your configuration and cuDNN's capabilities, particularly with specific convolution operations that your model might be using.
Even though your software versions (PyTorch, CUDA, and cuDNN) are compatible with each other, the error might be due to specific layer parameters or operations in the model that are not supported by your GPU. Hereβs what you could try:
- Verify Compatibility: Ensure that all layer configurations (like kernel sizes, padding, etc.) within your model are supported by cuDNN on your particular GPU.
- Update or Roll-back Software Versions: Although your current versions should work together, sometimes slight differences in update patches might cause unexpected issues. Trying a slightly different combination may help.
- Adjust Model Architecture: Itβs also possible that adjusting specific layer parameters might avoid this issue.
If none of these help, please provide more details about your model architecture and any modifications youβve made to it. This will help in diagnosing the issue better! π
from ultralytics.
@gerrylwk hey there! Thanks for sharing your solution! π It's great to see community members helping each other out. Using torch.backends.cudnn.benchmark = True
can indeed speed up the runtime by allowing cuDNN to automatically find the most efficient algorithms for your specific configuration. Disabling cuDNN can be a useful fallback when encountering compatibility issues. Both approaches are valid depending on the specific needs and setup. Keep up the great work, and happy coding with YOLOv8! π
from ultralytics.
Hello @aysent911,
Thank you for sharing your experience! It's great to hear that enabling torch.backends.cudnn.benchmark
and setting torch.backends.cudnn.deterministic
resolved the warning for you. These settings can indeed help optimize performance and ensure reproducibility:
torch.backends.cudnn.benchmark = True
allows cuDNN to find the most efficient algorithms for your hardware, which can speed up your model training and inference.torch.backends.cudnn.deterministic = True
ensures that operations are deterministic, which is useful for reproducibility.
Here's a quick summary of your solution for others who might encounter a similar issue:
import torch
from ultralytics import YOLO
import cv2
# Enable cuDNN benchmark and deterministic mode
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = True
# Load a pretrained YOLO model
model = YOLO("yolov5su.pt")
# Read an image
im2 = cv2.imread("test.png")
# Run prediction
results = model.predict(source=im2, conf=0.1, half=True, classes=[0])
This approach can be particularly helpful when working with models like ResNet50 on GPUs like the NVIDIA RTX 3050. If anyone else is facing similar issues, give this a try! π
Thanks again for contributing to the community, and happy coding!
from ultralytics.
Related Issues (20)
- *[.WATcH.]fullβ¬Inside Out 2 (2024)) (.FulLMovie+) Free Online On Streamings
- βΊ(LIMITED TIME) π¬ππππππ π GO Free Dice Links 2024 - Roll and Win! [ UWgE] HOT 1
- βΊ(LIMITED-EDITION) Free π¬ππππππ π Go Dice Links Today Roll and Claim! [ I1y1] HOT 1
- βΊ(NEW-UPDATED) HOW TO GET Free Rolls on π¬ππππππ π GO Get DICE ROLLS LINKS 2024 [ kdOin] HOT 1
- βΊ(NEW-UPDATED) π¬ππππππ π GO Free Dice Links 2024 [ QPNT] HOT 1
- βΊ(NEW-UPDATED)Roll into Action π¬ππππππ π Go Free Dice Links 2024! [ CyPSv] HOT 1
- βΊ(STRATEGY) π¬ππππππ π Go Dice Links Today Conquer the Board with Skill [ MGyl] HOT 1
- βΊ(UPDATE) π¬ππππππ π Go Free Dice Links Today [ wS3QF] HOT 1
- βΊ(UPDATED!) π¬ππππππ π GO Free Dice Links - Your Ticket to Fun and Prizes [ Vrl] HOT 1
- βΊ(UPDATED-EDITION) Free π¬ππππππ π Go Dice Links Today Grab Now! [ CbCi] HOT 1
- βΊClaim Your π¬ππππππ π Go Free Dice Links Roll Your Luck and Win Big! [ F1A7] HOT 1
- βΊFree π¬ππππππ π Go Dice Links Roll Your Way to Victory [ KeXS] HOT 1
- βΊπ¬ππππππ π Go Free Dice Rolls Links Today - Ultimate Guide [ v4Q2] HOT 1
- βΊStart Rolling with π¬ππππππ π Go Free Dice Links Today - Claim Now! [ sJrg] HOT 1
- βΊStart Your π¬ππππππ π GO Journey with Free Dice Links - Claim Now! [ FpCzf] HOT 1
- βΊThe Ultimate Advantage π¬ππππππ π Go Dice Rolls Free Today - Claim Now! [ FQ5sH] HOT 1
- βΊToday'S Free π¬ππππππ π Go Dice Links (Official Site) [ KVuC] HOT 1
- βΊToday'S Free π¬ππππππ π Go Dice Links Free [ j3p] HOT 1
- βΊ[PRIZES] Access Exclusive π¬ππππππ π Go Free Dice Links Today for Guaranteed Fun and Thrills! [ uETL] HOT 1
- Batch size with fraction does not work. HOT 3
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.