From b574fb100d41f5482e9565052a21893dc26a1a0d Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Fri, 23 May 2025 03:40:05 -0700 Subject: [PATCH] Resolve logger warnings Signed-off-by: Emmanuel Ferdman --- pytorch3d/implicitron/dataset/sql_dataset.py | 4 ++-- .../implicitron/models/visualization/render_flyaround.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pytorch3d/implicitron/dataset/sql_dataset.py b/pytorch3d/implicitron/dataset/sql_dataset.py index 4062cfc4..465c8a07 100644 --- a/pytorch3d/implicitron/dataset/sql_dataset.py +++ b/pytorch3d/implicitron/dataset/sql_dataset.py @@ -755,7 +755,7 @@ def _load_filter_eval_batches(self): if pick_sequences: old_len = len(eval_batches) eval_batches = [b for b in eval_batches if b[0][0] in pick_sequences] - logger.warn( + logger.warning( f"Picked eval batches by sequence/cat: {old_len} -> {len(eval_batches)}" ) @@ -763,7 +763,7 @@ def _load_filter_eval_batches(self): old_len = len(eval_batches) exclude_sequences = set(self.exclude_sequences) eval_batches = [b for b in eval_batches if b[0][0] not in exclude_sequences] - logger.warn( + logger.warning( f"Excluded eval batches by sequence: {old_len} -> {len(eval_batches)}" ) diff --git a/pytorch3d/implicitron/models/visualization/render_flyaround.py b/pytorch3d/implicitron/models/visualization/render_flyaround.py index 44ca3de5..2d352de7 100644 --- a/pytorch3d/implicitron/models/visualization/render_flyaround.py +++ b/pytorch3d/implicitron/models/visualization/render_flyaround.py @@ -304,11 +304,11 @@ def _show_predictions( assert isinstance(preds, list) pred_all = [] - # Randomly choose a subset of the rendered images, sort by ordr in the sequence + # Randomly choose a subset of the rendered images, sort by order in the sequence n_samples = min(n_samples, len(preds)) pred_idx = sorted(random.sample(list(range(len(preds))), n_samples)) for predi in pred_idx: - # Make the concatentation for the same camera vertically + # Make the concatenation for the same camera vertically pred_all.append( torch.cat( [ @@ -359,7 +359,7 @@ def _generate_prediction_videos( vws = {} for k in predicted_keys: if k not in preds[0]: - logger.warn(f"Cannot generate video for prediction key '{k}'") + logger.warning(f"Cannot generate video for prediction key '{k}'") continue cache_dir = ( None