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

Fix bug in issue #12457. #12459

Merged
merged 4 commits into from
Jan 3, 2024
Merged

Conversation

tiancailin
Copy link
Contributor

@tiancailin tiancailin commented Dec 2, 2023

When run 'python.exe segment/predict.py --visualize' will throw AttributeError: 'tuple' object has no attribute 'shape'

🤖[deprecated] Generated by Copilot at 29a9571

Summary

🐛🔬🎨

Fixed feature visualization for segmentation tasks by excluding Detect and Segment modules from utils/plots.py.

Detect and Segment
both unsuitable for viz
feature shapes differ

Walkthrough

  • Exclude 'Detect' and 'Segment' modules from feature visualization to prevent errors (link)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced feature visualization in YOLOv5 to support segmentation tasks.

📊 Key Changes

  • Expanded the condition to bypass feature visualization for non-Detect module types to also include non-Segment module types.

🎯 Purpose & Impact

  • 🛠️ Purpose: This change aims to enable the visual representation of the model's learned features not just for object detection (Detect) but also for segmentation tasks (Segment).
  • Impact: Helps developers and researchers to better understand and debug the internal workings of segmentation models, potentially leading to improvements in model performance and interpretability.
  • 📈 User Benefit: Provides users with additional insights into their models, specifically for those working on segmentation problems alongside detection tasks.

tiancailin and others added 2 commits December 2, 2023 22:53
When run 'python.exe segment/predict.py --visualize' will throw AttributeError: 'tuple' object has no attribute 'shape'
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @tiancailin, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with ultralytics/yolov5 master branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

@glenn-jocher
Copy link
Member

@tiancailin thanks for reporting this, we appreciate your help in making YOLOv5 more robust! This issue has been fixed in pull request #12459. Please update your local YOLOv5 repository with the latest changes, and 'python.exe segment/predict.py --visualize' should now work without throwing an AttributeError. If you encounter any more issues or have further questions, feel free to ask - we're here to help!

@akx
Copy link
Contributor

akx commented Jan 3, 2024

@glenn-jocher Why are you linking to this same unmerged pull request in your comment? 😄

@glenn-jocher glenn-jocher merged commit bd1a829 into ultralytics:master Jan 3, 2024
6 checks passed
@glenn-jocher
Copy link
Member

@tiancailin PR merged! Thank you for the fix :)

pleb631 pushed a commit to pleb631/yolov5 that referenced this pull request Jan 6, 2024
* Fix bug in ultralytics#12457.
When run 'python.exe segment/predict.py --visualize' will throw AttributeError: 'tuple' object has no attribute 'shape'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-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.

3 participants