Fix missing ultralytics
package on torch.hub.load()
#11950
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
May resolve #11945
π€ Generated by Copilot at 97bc939
Summary
ποΈπ¦π οΈ
Improved import handling and code style in
utils/general.py
. Added support forultralytics
package as an optional dependency.Walkthrough
ultralytics
package as a dependency and try to import it or install it if not found (link)import math
statement from the top of the file to thetry_import
function, where it is needed for some math operations (link, link)suffix
parameter ofcheck_suffix
function to follow Python style guide (link)π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Automatic
ultralytics
package check and installation.π Key Changes
models/common.py
andutils/general.py
.ultralytics
package, verifying it's not just a local directory with a version attribute check.ultralytics
package.π― Purpose & Impact
ultralytics
package is installed and up-to-date, avoiding errors due to missing or incorrect package versions.ultralytics
package; it's managed automatically, which streamlines initial setup and updates.