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

attempt_load() deserialize fix #8051

Merged
merged 1 commit into from
May 31, 2022
Merged

attempt_load() deserialize fix #8051

merged 1 commit into from
May 31, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 31, 2022

Per #8001 (comment)

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhancement of the model loading mechanism in the YOLOv5 library.

πŸ“Š Key Changes

  • Modified the attempt_load function within experimental.py.
  • Streamlined model weight loading by combining torch.load with map_location.

🎯 Purpose & Impact

  • Purpose: Simplifies the process of loading the model's weights onto the specified device, ensuring that the weights are immediately placed on the correct device during the loading process.
  • Impact: Improves efficiency by reducing device-to-device memory copy operations which can speed up initialization times, especially for systems with multiple GPUs or CPU-only systems. This can enhance the user experience by providing a more seamless setup and potentially reducing bugs related to device-specific weight loading.

@glenn-jocher glenn-jocher self-assigned this May 31, 2022
@glenn-jocher glenn-jocher merged commit 258f4c6 into master May 31, 2022
@glenn-jocher glenn-jocher deleted the fix/deserialize branch May 31, 2022 08:55
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
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.

Recent commit causes new "Attempting to deserialize object on a CUDA device" exception
1 participant