diff --git a/ignite/engine/engine.py b/ignite/engine/engine.py index 3f97a3035c7..bb2f9bfae05 100644 --- a/ignite/engine/engine.py +++ b/ignite/engine/engine.py @@ -812,11 +812,7 @@ def _run_once_on_dataset(self) -> float: # Should exit while loop if we can not iterate if should_exit: if not self._is_done(self.state): - total_iters = ( - self.state.epoch_length * self.state.max_epochs - if self.state.max_epochs is not None - else self.state.max_iters - ) + total_iters = self.state.epoch_length * self.state.max_epochs # type: ignore[operator] warnings.warn( "Data iterator can not provide data anymore but required total number of " diff --git a/ignite/handlers/checkpoint.py b/ignite/handlers/checkpoint.py index ed3b430bfc9..0e275a9ed4a 100644 --- a/ignite/handlers/checkpoint.py +++ b/ignite/handlers/checkpoint.py @@ -797,7 +797,7 @@ def __init__( self, dirname: str, filename_prefix: str, - save_interval: Optional[Callable] = None, + save_interval: Optional[int] = None, score_function: Optional[Callable] = None, score_name: Optional[str] = None, n_saved: Union[int, None] = 1, diff --git a/mypy.ini b/mypy.ini index 58fa118fd9e..2ee582b37eb 100644 --- a/mypy.ini +++ b/mypy.ini @@ -65,3 +65,6 @@ ignore_missing_imports = True [mypy-tqdm.*] ignore_missing_imports = True + +[mypy-ignite.contrib.handlers.custom_events] +ignore_errors = True \ No newline at end of file