Skip to content

Commit

Permalink
change to misconfig exception
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellepintz committed Oct 18, 2021
1 parent f4b8351 commit 39ca979
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytorch_lightning/trainer/configuration_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def verify_loop_configurations(trainer: "pl.Trainer", model: "pl.LightningModule
__verify_predict_loop_configuration(model)
__verify_dp_batch_transfer_support(trainer, model)
_check_add_get_queue(model)
# TODO(@daniellepintz): Delete _check_progress_bar in v1.7
# TODO: Delete _check_progress_bar in v1.7
_check_progress_bar(model)
# TODO: Delete _check_on_post_move_to_device in v1.7
_check_on_post_move_to_device(model)
Expand Down Expand Up @@ -151,9 +151,9 @@ def __verify_eval_loop_configuration(model: "pl.LightningModule", stage: str) ->
has_step = is_overridden(step_name, model)

if has_loader and not has_step:
rank_zero_warn(f"you passed in a {loader_name} but have no {step_name}. Skipping {stage} loop")
MisconfigurationException(f"You defined `{loader_name}` but have not defined `{step_name}` on your Lightning Module.")
if has_step and not has_loader:
rank_zero_warn(f"you defined a {step_name} but have no {loader_name}. Skipping {stage} loop")
MisconfigurationException(f"You defined `{step_name}` but have not defined `{loader_name}` on your Lighning Module.")

# ----------------------------------------------
# verify model does not have
Expand All @@ -178,7 +178,7 @@ def __verify_eval_loop_configuration(model: "pl.LightningModule", stage: str) ->
def __verify_predict_loop_configuration(model: "pl.LightningModule") -> None:
has_predict_dataloader = is_overridden("predict_dataloader", model)
if not has_predict_dataloader:
raise MisconfigurationException("Dataloader not found for `Trainer.predict`")
raise MisconfigurationException("Please define `predict_dataloader` on your Lightning Module")
# ----------------------------------------------
# verify model does not have
# - on_predict_dataloader
Expand Down

0 comments on commit 39ca979

Please sign in to comment.