Skip to content

Commit

Permalink
Improve the error message for installing tensorboardx (#17053)
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli authored Mar 14, 2023
1 parent 550fa5f commit a22242b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lightning/fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Fixed issue where the wrapped dataloader `iter()` would be called twice ([#16841](https://github.com/Lightning-AI/lightning/pull/16841))

- Improved the error message for installing tensorboard or tensorboardx ([#17053](https://github.com/Lightning-AI/lightning/pull/17053))


## [1.9.4] - 2023-03-01

Expand Down
3 changes: 2 additions & 1 deletion src/lightning/fabric/loggers/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def __init__(
):
if not _TENSORBOARD_AVAILABLE and not _TENSORBOARDX_AVAILABLE:
raise ModuleNotFoundError(
"Neither `tensorboard` nor `tensorboardX` is available. Try `pip install`ing either."
"Neither `tensorboard` nor `tensorboardX` is available. Try `pip install`ing either.\n"
f"{str(_TENSORBOARDX_AVAILABLE)}\n{str(_TENSORBOARD_AVAILABLE)}"
)
super().__init__()
root_dir = os.fspath(root_dir)
Expand Down
3 changes: 3 additions & 0 deletions src/lightning/pytorch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed an issue with comparing torch versions when using a version of torch built from source ([#17030](https://github.com/Lightning-AI/lightning/pull/17030))


- Improved the error message for installing tensorboard or tensorboardx ([#17053](https://github.com/Lightning-AI/lightning/pull/17053))


## [1.9.4] - 2023-03-01

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/lightning/pytorch/loggers/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def __init__(
**kwargs,
)
if log_graph and not _TENSORBOARD_AVAILABLE:
rank_zero_warn("You set `TensorBoardLogger(log_graph=True)` but `tensorboard` is not available.")
rank_zero_warn(
"You set `TensorBoardLogger(log_graph=True)` but `tensorboard` is not available.\n"
f"{str(_TENSORBOARD_AVAILABLE)}"
)
self._log_graph = log_graph and _TENSORBOARD_AVAILABLE
self.hparams: Union[Dict[str, Any], Namespace] = {}

Expand Down

0 comments on commit a22242b

Please sign in to comment.