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:
parent
c6dd277493
commit
daaebba220
5 changed files with 6 additions and 17 deletions
|
|
@ -7,6 +7,7 @@ import types
|
|||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
|
||||
import thop
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
|
|
@ -86,11 +87,6 @@ from ultralytics.utils.torch_utils import (
|
|||
time_sync,
|
||||
)
|
||||
|
||||
try:
|
||||
import thop
|
||||
except ImportError:
|
||||
thop = None
|
||||
|
||||
|
||||
class BaseModel(nn.Module):
|
||||
"""The BaseModel class serves as a base class for all the models in the Ultralytics YOLO family."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue