ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
48.29k stars 15.85k forks source link

about physical memory and virtual memory #13058

Open Songpenglei123 opened 1 month ago

Songpenglei123 commented 1 month ago

Search before asking

Question

Why are all the images loaded into the virtual memory during training? I set the virtual memory to about 300g and the physical memory to 128g 屏幕截图 2024-06-01 120034

Additional

No response

glenn-jocher commented 1 month ago

@Songpenglei123 hello! Thank you for reaching out with your question. 🌟

During training, YOLOv5 utilizes virtual memory to handle large datasets that might not fit entirely into physical RAM. This approach allows the system to swap parts of the data between physical memory and disk space (virtual memory), enabling the processing of larger datasets without running out of physical memory.

The usage of virtual memory as you described seems to be a part of this mechanism, especially when dealing with extensive data or high-resolution images. If you find that the virtual memory usage is excessively high, you might consider:

These adjustments can help manage memory usage more effectively during training. If you have further questions or need more specific advice, feel free to ask!