Skip to content

Commit a22242b

Browse files
authored
Improve the error message for installing tensorboardx (Lightning-AI#17053)
1 parent 550fa5f commit a22242b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/lightning/fabric/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
7676

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

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

8082
## [1.9.4] - 2023-03-01
8183

src/lightning/fabric/loggers/tensorboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def __init__(
9191
):
9292
if not _TENSORBOARD_AVAILABLE and not _TENSORBOARDX_AVAILABLE:
9393
raise ModuleNotFoundError(
94-
"Neither `tensorboard` nor `tensorboardX` is available. Try `pip install`ing either."
94+
"Neither `tensorboard` nor `tensorboardX` is available. Try `pip install`ing either.\n"
95+
f"{str(_TENSORBOARDX_AVAILABLE)}\n{str(_TENSORBOARD_AVAILABLE)}"
9596
)
9697
super().__init__()
9798
root_dir = os.fspath(root_dir)

src/lightning/pytorch/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
439439
- 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))
440440

441441

442+
- Improved the error message for installing tensorboard or tensorboardx ([#17053](https://github.com/Lightning-AI/lightning/pull/17053))
443+
444+
442445
## [1.9.4] - 2023-03-01
443446

444447
### Added

src/lightning/pytorch/loggers/tensorboard.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def __init__(
117117
**kwargs,
118118
)
119119
if log_graph and not _TENSORBOARD_AVAILABLE:
120-
rank_zero_warn("You set `TensorBoardLogger(log_graph=True)` but `tensorboard` is not available.")
120+
rank_zero_warn(
121+
"You set `TensorBoardLogger(log_graph=True)` but `tensorboard` is not available.\n"
122+
f"{str(_TENSORBOARD_AVAILABLE)}"
123+
)
121124
self._log_graph = log_graph and _TENSORBOARD_AVAILABLE
122125
self.hparams: Union[Dict[str, Any], Namespace] = {}
123126

0 commit comments

Comments
 (0)