-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Print imgsz information along with FLOPs #16955
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
base: main
Are you sure you want to change the base?
Conversation
👋 Hello @Y-T-G, thank you for submitting a pull request to the
For detailed guidelines, please refer to our Contributing Guide. Feel free to reach out if you have any queries. Thank you for your valuable contribution! 🌟🚀 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16955 +/- ##
==========================================
- Coverage 75.15% 75.12% -0.04%
==========================================
Files 144 144
Lines 19278 19278
==========================================
- Hits 14489 14483 -6
- Misses 4789 4795 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
On second thought, it might cause confusion in the sense that users might think the training is running at |
Best thing would be to use the |
@Y-T-G yes I looked at this before, it would be nice to always show flops at the imgsz arg the user passed, but this required some changes to carry that information down to the lower level functions. This would be the ideal solution though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change, but what about updating to make it a bit more explicit? I think this would be a bit more clear.
@@ -324,7 +324,7 @@ def model_info(model, detailed=False, verbose=True, imgsz=640): | |||
|
|||
flops = get_flops(model, imgsz) | |||
fused = " (fused)" if getattr(model, "is_fused", lambda: False)() else "" | |||
fs = f", {flops:.1f} GFLOPs" if flops else "" | |||
fs = f", {flops:.1f} GFLOPs (imgsz={imgsz})" if flops else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fs = f", {flops:.1f} GFLOPs (imgsz={imgsz})" if flops else ""
+ fs = f", {flops:.1f} GFLOPs (at imgsz = {imgsz})" if flops else ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of adding "at". I guess it makes it clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you should be able make it a bit shorter using this:
fs = f", {flops:.1f} GFLOPs (at {imgsz = })" if flops else ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.
@@ -324,7 +324,7 @@ def model_info(model, detailed=False, verbose=True, imgsz=640): | |||
|
|||
flops = get_flops(model, imgsz) | |||
fused = " (fused)" if getattr(model, "is_fused", lambda: False)() else "" | |||
fs = f", {flops:.1f} GFLOPs" if flops else "" | |||
fs = f", {flops:.1f} GFLOPs (imgsz={imgsz})" if flops else "" | |||
yaml_file = getattr(model, "yaml_file", "") or getattr(model, "yaml", {}).get("yaml_file", "") | |||
model_name = Path(yaml_file).stem.replace("yolo", "YOLO") or "Model" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question here, if verbose is false, return None, this is a little bit weird, I think silence print is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because sometimes, we only want to get mode_info without print.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, makes sense
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap. We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved. For additional resources and information, please see the links below:
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
FLOPs value is connected to
imgsz
, so print that alongside GFLOPs. Avoids confusion like in #16919 (comment)🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhances model summary output with additional image size information in FLOPs calculation.
📊 Key Changes
model_info
function to include image size (imgsz
) in the model's GFLOPs (Giga Floating Point Operations) output.🎯 Purpose & Impact