Fix TypeError in check_cfg() (#9245)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
3c179f87cb
commit
528793f452
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue