Simplify thop imports (#18717)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2025-01-16 22:27:27 +01:00 committed by GitHub
parent c6dd277493
commit daaebba220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 17 deletions

View file

@ -1131,7 +1131,7 @@ class TorchVision(nn.Module):
def __init__(self, c1, c2, model, weights="DEFAULT", unwrap=True, truncate=2, split=False):
"""Load the model and weights from torchvision."""
import torchvision
import torchvision # scope for faster 'import ultralytics'
super().__init__()
if hasattr(torchvision.models, "get_model"):