-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Train YOLOV5 in 2 or 3 times, because of insufficient memory to train the all dataset in one time #8477
Comments
👋 Hello @EdouardEPFL, 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 screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. 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 (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
@EdouardEPFL 👋 Hello! Thanks for asking about CUDA memory issues. YOLOv5 🚀 can be trained on CPU, single-GPU, or multi-GPU. When training on GPU it is important to keep your batch-size small enough that you do not use all of your GPU memory, otherwise you will see a CUDA Out Of Memory (OOM) Error and your training will crash. You can observe your CUDA memory utilization using either the CUDA Out of Memory SolutionsIf you encounter a CUDA OOM error, the steps you can take to reduce your memory usage are:
AutoBatchYou can use YOLOv5 AutoBatch (NEW) to find the best batch size for your training by passing Good luck 🍀 and let us know if you have any other questions! |
Hello, thank you for the answer but I wasn't talking about gpu memory. I was talking about RAM-Memory because of --cache. However thank you for those explanations about the gpu memory |
@EdouardEPFL oh, well if RAM caching is using up all your memory then you can try disk caching:
|
Thank you very much, tha'ts what I was looking for ! |
@EdouardEPFL you're welcome! If you have any more questions or need further assistance, feel free to ask. Good luck with your training! |
Search before asking
Question
I'm currently trying to train on a custom dataset that has around 25k images.
Despite a good computer configuration: 32,0 GO of memory,
AMD Ryzen 7 3800X 8-Core
NVIDIA Quadro RTX4000
I'm facing the problem of the
error: (-4:Insufficient memory) Failed to allocate xxxx bytes in function 'cv::OutOfMemoryError'
Hence, as I don't want to downscale my images or reduce my dataset or disable the --cache options, I wanted to know if I can train my model in 2 or 3 times to avoid the problem.
I'm also wondering (if it's not possible to train in few times), if I should use transfer learning to learn in 2 or 3 times as I'm training with weights from scratch.
Thank you in advance for any kind of help.
Additional
No response
The text was updated successfully, but these errors were encountered: