diff --git a/src/lumo/trainer/trainer.py b/src/lumo/trainer/trainer.py index 9564882..27338f9 100644 --- a/src/lumo/trainer/trainer.py +++ b/src/lumo/trainer/trainer.py @@ -31,6 +31,8 @@ # overwrite send_to_device to resolve https://github.com/pytorch/pytorch/issues/83015 # from accelerate import Accelerator # from accelerate.utils import send_to_device +from ..utils.fmt import strftime + ParamsType = TrainerParams @@ -514,7 +516,7 @@ def to_device(self, item: Optional[Union[nn.Module, torch.Tensor, Sequence, Mapp def on_trainer_exception(self, func: Callable, exception: BaseException): """Updates database with error information when an exception occurs during training.""" - self.exp.dump_info('exception', dict(end=datetime.now(), + self.exp.dump_info('exception', dict(end=strftime(), finished=False, error=str(exception), trainer_frame=str(func)))