ultralytics 8.0.153 YOLO Tasks Cleanup (#4314)
This commit is contained in:
parent
39395aedc8
commit
822608986c
22 changed files with 87 additions and 55 deletions
|
|
@ -9,7 +9,7 @@ from ultralytics.cfg import get_cfg
|
|||
from ultralytics.engine.exporter import Exporter
|
||||
from ultralytics.hub.utils import HUB_WEB_ROOT
|
||||
from ultralytics.nn.tasks import attempt_load_one_weight, guess_model_task, nn, yaml_model_load
|
||||
from ultralytics.utils import (DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_KEYS, LOGGER, RANK, ROOT, callbacks,
|
||||
from ultralytics.utils import (DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_KEYS, LOGGER, RANK, ROOT, callbacks, emojis,
|
||||
is_git_dir, yaml_load)
|
||||
from ultralytics.utils.checks import check_file, check_imgsz, check_pip_update_available, check_yaml
|
||||
from ultralytics.utils.downloads import GITHUB_ASSET_STEMS
|
||||
|
|
@ -448,11 +448,11 @@ class Model:
|
|||
"""Load model/trainer/validator/predictor."""
|
||||
try:
|
||||
return self.task_map[self.task][key]
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
name = self.__class__.__name__
|
||||
mode = inspect.stack()[1][3] # get the function name.
|
||||
raise NotImplementedError(
|
||||
f'WARNING ⚠️ `{name}` model does not support `{mode}` mode for `{self.task}` task yet.')
|
||||
emojis(f'WARNING ⚠️ `{name}` model does not support `{mode}` mode for `{self.task}` task yet.')) from e
|
||||
|
||||
@property
|
||||
def task_map(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue