From 554015797bea9f33971ca5bc3c63854a979c2b6a Mon Sep 17 00:00:00 2001 From: kunze Date: Wed, 7 Aug 2024 11:57:07 +0200 Subject: [PATCH 1/2] fix: #52 - should_prune() takes no argument --- pyannote/pipeline/optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyannote/pipeline/optimizer.py b/pyannote/pipeline/optimizer.py index 06d1f7c..1835c38 100644 --- a/pyannote/pipeline/optimizer.py +++ b/pyannote/pipeline/optimizer.py @@ -253,7 +253,7 @@ def objective(trial: Trial) -> float: continue trial.report(np.mean(losses) if metric is None else abs(metric), i) - if trial.should_prune(i): + if trial.should_prune(): raise optuna.structs.TrialPruned() if show_progress != False: From 7b57cf03fe536c8f7b580de1ddb91d97e97db446 Mon Sep 17 00:00:00 2001 From: arxaqapi Date: Wed, 7 Aug 2024 18:12:51 +0200 Subject: [PATCH 2/2] fix: module 'optuna' has no attribute 'structs' --- pyannote/pipeline/optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyannote/pipeline/optimizer.py b/pyannote/pipeline/optimizer.py index 1835c38..0336743 100644 --- a/pyannote/pipeline/optimizer.py +++ b/pyannote/pipeline/optimizer.py @@ -254,7 +254,7 @@ def objective(trial: Trial) -> float: trial.report(np.mean(losses) if metric is None else abs(metric), i) if trial.should_prune(): - raise optuna.structs.TrialPruned() + raise optuna.TrialPruned() if show_progress != False: progress_bar.close()