Skip to content

Update export.py with --train mode argument - #3066

Merged
glenn-jocher merged 1 commit into
masterfrom
glenn-jocher-patch-5
May 7, 2021
Merged

glenn-jocher merged 1 commit into
masterfrom
glenn-jocher-patch-5

Conversation

@glenn-jocher

@glenn-jocher glenn-jocher commented May 7, 2021 •

Copy link
Copy Markdown
Member

This will allow error-free export of YOLOv5 to CoreML models. All ops are included except for the Detect layer grid reconstruction, which is not used during training. The model will output the 3 or 4 output layers rather than the concatenated reconstructed grid output used during .eval() mode.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced export script with training mode option 🛠️

📊 Key Changes

  • Added an argument (--train) to the export script allowing users to specify training mode during export.
  • Ensured compatibility with PyTorch 1.6.0 by setting non-persistent buffer sets.

🎯 Purpose & Impact

  • Purpose: The addition of --train allows the model to be exported in training mode, which is useful for continuing training or fine-tuning on other datasets.
  • Impact: Users will have more flexibility in how they export models, potentially improving the model's adaptability to various tasks. It also assures better forward compatibility with older versions of PyTorch.

@glenn-jocher

Copy link
Copy Markdown
Member Author

Should resolve #2961

@glenn-jocher
glenn-jocher merged commit e97d129 into master May 7, 2021
@glenn-jocher
glenn-jocher deleted the glenn-jocher-patch-5 branch May 7, 2021 11:10
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
danny-schwartz7 pushed a commit to danny-schwartz7/yolov5 that referenced this pull request May 22, 2021
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 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.

1 participant