diff --git a/src/pytorch_lightning/trainer/connectors/logger_connector/fx_validator.py b/src/pytorch_lightning/trainer/connectors/logger_connector/fx_validator.py index f1478ecbf9cbe..686d3a364cbf4 100644 --- a/src/pytorch_lightning/trainer/connectors/logger_connector/fx_validator.py +++ b/src/pytorch_lightning/trainer/connectors/logger_connector/fx_validator.py @@ -174,7 +174,10 @@ def check_logging(cls, fx_name: str) -> None: ) if cls.functions[fx_name] is None: - raise MisconfigurationException(f"You can't `self.log()` inside `{fx_name}`.") + raise MisconfigurationException( + f"You can't `self.log()` inside `{fx_name}`. HINT: You can still log directly to the logger by using" + " `self.logger.experiment`." + ) @classmethod def get_default_logging_levels(