diff --git a/src/base_tester.py b/src/base_tester.py index 55ecf52..e71270c 100644 --- a/src/base_tester.py +++ b/src/base_tester.py @@ -39,6 +39,7 @@ def __init__( train_loader (torch.utils.data.DataLoader): Training dataloader. val_loader (torch.utils.data.DataLoader): Validation dataloader. """ + _ = kwargs self._run_name = run_name self._model = model assert model_ckpt_path is not None, "No model checkpoint path provided." @@ -54,7 +55,9 @@ def _visualize( batch: Union[Tuple, List, torch.Tensor], epoch: int, ) -> None: - pass + _ = epoch + _ = batch + raise NotImplementedError("You must implement the _visualize method.") @to_cuda def _test_iteration( @@ -79,6 +82,7 @@ def test(self, visualize_every: int = 0, **kwargs): visualize_every (int, optional): Visualize the model predictions every n batches. Defaults to 0 (no visualization). """ + _ = kwargs test_loss: MeanMetric = MeanMetric() test_metrics: Dict[str, MeanMetric] = defaultdict(MeanMetric) self._model.eval() diff --git a/src/base_trainer.py b/src/base_trainer.py index 1658c0e..bffae53 100644 --- a/src/base_trainer.py +++ b/src/base_trainer.py @@ -49,6 +49,7 @@ def __init__( train_loader (torch.utils.data.DataLoader): Training dataloader. val_loader (torch.utils.data.DataLoader): Validation dataloader. """ + _ = kwargs self._run_name = run_name self._model = model self._opt = opt @@ -98,6 +99,8 @@ def _train_val_iteration( torch.Tensor: The loss for the batch. Dict[str, torch.Tensor]: The loss components for the batch. """ + _ = epoch + _ = validation # TODO: You'll most likely want to override this method. x, y = batch y_hat = self._model(x) @@ -433,6 +436,8 @@ def _terminator(self, sig, frame): """ Handles the SIGINT signal (Ctrl+C) and stops the training loop. """ + _ = sig + _ = frame if ( project_conf.SIGINT_BEHAVIOR == project_conf.TerminationBehavior.WAIT_FOR_EPOCH_END diff --git a/utils/training.py b/utils/training.py index f2c9b80..53815c2 100644 --- a/utils/training.py +++ b/utils/training.py @@ -15,13 +15,14 @@ import torch import conf.project as project_conf -from utils import to_cuda_ def visualize_model_predictions( model: torch.nn.Module, batch: Union[Tuple, List, torch.Tensor], step: int ) -> None: - x, y = to_cuda_(batch) # type: ignore + _ = model + _ = step + _ = batch if not project_conf.HEADLESS: raise NotImplementedError("Visualization is not implemented.") if project_conf.USE_WANDB: