Fix tests for new tensorboard >= 2.6 (#8789)

This commit is contained in:
Adrian Wälchli 2021-08-09 15:12:38 +02:00 committed by GitHub
parent e7440d68c3
commit 346cef2c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import operator
import os
from argparse import Namespace
from unittest import mock
@ -20,14 +21,19 @@ import pytest
import torch
import yaml
from omegaconf import OmegaConf
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.utilities.imports import _compare_version
from tests.helpers import BoringModel
@pytest.mark.skipif(
_compare_version("tensorboard", operator.ge, "2.6.0"), reason="cannot import EventAccumulator in >= 2.6.0"
)
def test_tensorboard_hparams_reload(tmpdir):
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
class CustomModel(BoringModel):
def __init__(self, b1=0.5, b2=0.999):
super().__init__()