fix(loggers): DVCLive add package version check (#3112)
This commit is contained in:
parent
29c954a138
commit
3892e38021
1 changed files with 8 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
|||
# Ultralytics YOLO 🚀, GPL-3.0 license
|
||||
import os
|
||||
|
||||
import pkg_resources as pkg
|
||||
|
||||
from ultralytics.yolo.utils import LOGGER, TESTS_RUNNING
|
||||
from ultralytics.yolo.utils.torch_utils import get_flops, get_num_params
|
||||
|
||||
|
|
@ -10,8 +12,12 @@ try:
|
|||
import dvclive
|
||||
|
||||
assert not TESTS_RUNNING # do not log pytest
|
||||
assert version('dvclive')
|
||||
except (ImportError, AssertionError):
|
||||
|
||||
ver = version('dvclive')
|
||||
if pkg.parse_version(ver) < pkg.parse_version('2.11.0'):
|
||||
LOGGER.debug(f'DVCLive is detected but version {ver} is incompatible (>=2.11 required).')
|
||||
dvclive = None # noqa: F811
|
||||
except (ImportError, AssertionError, TypeError):
|
||||
dvclive = None
|
||||
|
||||
# DVCLive logger instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue