Skip to content

Commit 9e44c65

Browse files
awaelchlilexierule
authored andcommitted
Fix tests for new tensorboard >= 2.6 (#8789)
(cherry picked from commit 346cef2)
1 parent f6b8b69 commit 9e44c65

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/loggers/test_tensorboard.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import logging
15+
import operator
1516
import os
1617
from argparse import Namespace
1718
from unittest import mock
@@ -20,14 +21,19 @@
2021
import torch
2122
import yaml
2223
from omegaconf import OmegaConf
23-
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
2424

2525
from pytorch_lightning import Trainer
2626
from pytorch_lightning.loggers import TensorBoardLogger
27+
from pytorch_lightning.utilities.imports import _compare_version
2728
from tests.helpers import BoringModel
2829

2930

31+
@pytest.mark.skipif(
32+
_compare_version("tensorboard", operator.ge, "2.6.0"), reason="cannot import EventAccumulator in >= 2.6.0"
33+
)
3034
def test_tensorboard_hparams_reload(tmpdir):
35+
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
36+
3137
class CustomModel(BoringModel):
3238
def __init__(self, b1=0.5, b2=0.999):
3339
super().__init__()

0 commit comments

Comments
 (0)