From b73f9b13df1f4a940d64116bbd416c793677ce18 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:32:39 +0800 Subject: [PATCH] Fix incorrect device selection when resuming training (#4301) --- ultralytics/engine/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/engine/trainer.py b/ultralytics/engine/trainer.py index 9532d30..062a3b1 100644 --- a/ultralytics/engine/trainer.py +++ b/ultralytics/engine/trainer.py @@ -80,8 +80,8 @@ class BaseTrainer: overrides (dict, optional): Configuration overrides. Defaults to None. """ self.args = get_cfg(cfg, overrides) - self.device = select_device(self.args.device, self.args.batch) self.check_resume() + self.device = select_device(self.args.device, self.args.batch) self.validator = None self.model = None self.metrics = None