diff --git a/skrl/resources/schedulers/torch/kl_adaptive.py b/skrl/resources/schedulers/torch/kl_adaptive.py index 0c97f50f..0a32eed3 100644 --- a/skrl/resources/schedulers/torch/kl_adaptive.py +++ b/skrl/resources/schedulers/torch/kl_adaptive.py @@ -1,5 +1,7 @@ from typing import Optional, Union +from packaging import version + import torch from torch.optim.lr_scheduler import _LRScheduler @@ -50,6 +52,8 @@ def __init__(self, :param verbose: Verbose mode (default: ``False``) :type verbose: bool, optional """ + if version.parse(torch.__version__) >= version.parse("2.2"): + verbose = "deprecated" super().__init__(optimizer, last_epoch, verbose) self.kl_threshold = kl_threshold