__init__.py 647 B

123456789101112131415
  1. import importlib
  2. import sys
  3. from ultralytics.utils import LOGGER
  4. # Set modules in sys.modules under their old name
  5. sys.modules['ultralytics.yolo.utils'] = importlib.import_module('ultralytics.utils')
  6. UTILS_WARNING = """WARNING ⚠️ 'ultralytics.yolo.utils' is deprecated since '8.0.136' and will be removed in '8.1.0'. Please use 'ultralytics.utils' instead.
  7. Note this warning may be related to loading older models. You can update your model to current structure with:
  8. import torch
  9. ckpt = torch.load("model.pt") # applies to both official and custom models
  10. torch.save(ckpt, "updated-model.pt")
  11. """
  12. LOGGER.warning(UTILS_WARNING)