Skip to content

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 1, 2022

To disable pin_memory during training/val, i.e.

PIN_MEMORY=False python train.py 

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced configuration for data loader memory pinning.

📊 Key Changes

  • Introduced a new environment variable PIN_MEMORY with default value True.
  • Replaced hardcoded pin_memory parameters in data loader functions with the new PIN_MEMORY variable.

🎯 Purpose & Impact

  • User Customization: Allows users to set the pin_memory option via an environment variable, enhancing flexibility and control.
  • Resource Management: This change can help optimize memory usage for different hardware setups, possibly improving performance.
  • Ease of Use: Setting the pin_memory at one place (environment variable) rather than in multiple lines of code improves code maintainability and readability.

Signed-off-by: Glenn Jocher <[email protected]>
@glenn-jocher glenn-jocher linked an issue Sep 1, 2022 that may be closed by this pull request
2 tasks
@glenn-jocher glenn-jocher merged commit c91d1db into master Sep 1, 2022
@glenn-jocher glenn-jocher deleted the update/pin_memory branch September 1, 2022 12:30
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Signed-off-by: Glenn Jocher <[email protected]>

Signed-off-by: Glenn Jocher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception after training on Docker image e88040337fa3

1 participant