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

Update dataloaders.py #9250

Merged
merged 1 commit into from
Sep 1, 2022
Merged

Update dataloaders.py #9250

merged 1 commit into from
Sep 1, 2022

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 <glenn.jocher@ultralytics.com>
@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 <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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