From 46bcc6e38ab47d503eb677deda0c9f8230f299cc Mon Sep 17 00:00:00 2001 From: tarekabouchakra Date: Tue, 5 Dec 2023 08:06:19 +0100 Subject: [PATCH] resolves #26; resolving deprecation warning --- src/neps/api.py | 2 +- src/neps/plot/tensorboard_eval.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/neps/api.py b/src/neps/api.py index 5c135e42..bc891846 100644 --- a/src/neps/api.py +++ b/src/neps/api.py @@ -253,7 +253,7 @@ def run( ) elif isinstance(searcher, BaseOptimizer): # This check is not strict when a user-defined neps.optimizer is provided - logger.warn( + logger.warning( "An instantiated optimizer is provided. The safety checks of NePS will be " "skipped. Accurate continuation of runs can no longer be guaranteed!" ) diff --git a/src/neps/plot/tensorboard_eval.py b/src/neps/plot/tensorboard_eval.py index 43881c99..58fb9f9b 100644 --- a/src/neps/plot/tensorboard_eval.py +++ b/src/neps/plot/tensorboard_eval.py @@ -2,10 +2,18 @@ import math import os +import warnings from pathlib import Path import numpy as np import torch + +# Remove this once we support pytorch > 2.1.0 +# https://github.com/automl/neps/issues/26 +warnings.filterwarnings( + "ignore", category=DeprecationWarning, module="torch.utils.tensorboard" +) + from torch.utils.tensorboard import SummaryWriter from torch.utils.tensorboard.summary import hparams