Skip to content
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

Why is there a memory overflow when the total gpu memory is 12g and each batch uses 4.5g #13395

Open
1 task done
heyxhh opened this issue Nov 1, 2024 · 1 comment
Open
1 task done
Labels
question Further information is requested

Comments

@heyxhh
Copy link

heyxhh commented Nov 1, 2024

Search before asking

Question

Hello,I tried to train YOLO V5 with config "imgsz=640, batch_size=16", there was no problem in the first two training epochs, but a gpu memory overflow occurred during the loading of data in the third epoch. The total gpu memory is 12g and each batch uses 4.5g, may I ask what could be the reason for this, The details of the problem can be seen in the screenshot。

ques

Additional

No response

@heyxhh heyxhh added the question Further information is requested label Nov 1, 2024
@UltralyticsAssistant
Copy link
Member

👋 Hello @heyxhh, thank you for reaching out and sharing your question about YOLOv5 🚀!

GPU memory overflow can be a tricky issue to debug. To help us better understand and assist you, could you please provide a minimum reproducible example? This would include any configurations you are using and, if possible, a snippet of your code. Also, let us know if there are any specific error messages you are encountering, as shown in your screenshot.

In the meantime, you might want to verify whether your environment meets the requirements:

  • Python version 3.8.0 or higher
  • All dependencies installed via requirements.txt
  • Ensure that your PyTorch and CUDA versions are compatible with your hardware and setup

YOLOv5 is optimized to run in a variety of environments, and keeping your drivers up to date can sometimes resolve memory issues.

Remember, this is an automated response 🤖, and an Ultralytics engineer will review your issue soon to provide more personalized assistance. Thank you for your patience and understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants