ultralytics 8.1.41 DDP resume untrained-checkpoint fix (#9453)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
parent
2cee8893d9
commit
959acf67db
4 changed files with 12 additions and 15 deletions
|
|
@ -513,7 +513,7 @@ def convert_optimizer_state_dict_to_fp16(state_dict):
|
|||
"""
|
||||
for state in state_dict["state"].values():
|
||||
for k, v in state.items():
|
||||
if isinstance(v, torch.Tensor) and v.dtype is torch.float32:
|
||||
if k != "step" and isinstance(v, torch.Tensor) and v.dtype is torch.float32:
|
||||
state[k] = v.half()
|
||||
|
||||
return state_dict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue