Fix TypeError in check_cfg() (#9245)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/9102/head^2
zhaoruibing 1 year ago committed by GitHub
parent 3c179f87cb
commit 528793f452
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/cfg/__init__.py

@ -243,7 +243,7 @@ def check_cfg(cfg, hard=True):
f"'{k}={v}' is of invalid type {type(v).__name__}. "
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
)
cfg[k] = float(v)
cfg[k] = v = float(v)
if not (0.0 <= v <= 1.0):
raise ValueError(f"'{k}={v}' is an invalid value. " f"Valid '{k}' values are between 0.0 and 1.0.")
elif k in CFG_INT_KEYS and not isinstance(v, int):

Loading…
Cancel
Save