ultralytics 8.2.41 fix HUB unzip subdirectory bug (#13913)

This commit is contained in:
Glenn Jocher 2024-06-23 21:15:57 +02:00 committed by GitHub
parent 9362e759f7
commit e30b7c24f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 7 deletions

View file

@ -71,7 +71,11 @@ class HUBTrainingSession:
"""Class method to create an authenticated HUBTrainingSession or return None."""
try:
session = cls(identifier)
assert session.client.authenticated, "HUB not authenticated"
if not session.client.authenticated:
if identifier.startswith(f"{HUB_WEB_ROOT}/models/"):
LOGGER.warning(f"{PREFIX}WARNING ⚠️ Login to Ultralytics HUB with 'yolo hub login API_KEY'.")
exit()
return None
if args and not identifier.startswith(f"{HUB_WEB_ROOT}/models/"): # not a HUB model URL
session.create_model(args)
assert session.model.id, "HUB model not loaded correctly"