diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml index 1c4a8d826f..b718596044 100644 --- a/.github/workflows/ci_test-base.yml +++ b/.github/workflows/ci_test-base.yml @@ -44,9 +44,9 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements/base.txt') }} + key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements/base.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip- + ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}- - name: Install dependencies run: | diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 493587b04b..196869611c 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -75,9 +75,9 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements/base.txt') }}-${{ hashFiles('requirements/extra.txt') }} + key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements/base.txt') }}-${{ hashFiles('requirements/extra.txt') }} restore-keys: | - ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}-pip- + ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.requires }}- - name: Install dependencies run: | diff --git a/environment.yml b/environment.yml index 85a639cd33..c9856baab7 100644 --- a/environment.yml +++ b/environment.yml @@ -27,14 +27,14 @@ dependencies: - pip>=20.0.2 - numpy>=1.16.4 - pytorch>=1.3 - - tensorboard==2.2.1 - future>=0.17.1 - PyYAML>=5.1 - tqdm>=4.41.0 - fsspec>=0.8.0 - - nvidia-apex + #- tensorboard>=2.2.0 # Optional + - nvidia-apex - scikit-learn>=0.20.0 - matplotlib>=3.1.1 - omegaconf>=2.0.0 diff --git a/requirements/base.txt b/requirements/base.txt index 3e30d2b93d..0f8423e086 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -2,9 +2,9 @@ numpy>=1.16.4 torch>=1.3 -tensorboard==2.2.0 future>=0.17.1 # required for builtins in setup.py # pyyaml>=3.13 PyYAML>=5.1 # OmegaConf requirement >=5.1 tqdm>=4.41.0 fsspec>=0.8.0 +tensorboard>=2.2.0 diff --git a/requirements/test.txt b/requirements/test.txt index 312f100c60..d98048568f 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -8,7 +8,7 @@ flake8-black check-manifest twine==1.13.0 scikit-image -black==19.10b0 +black>=20.8b1 pre-commit>=1.0 cloudpickle>=1.2 diff --git a/tests/collect_env_details.py b/tests/collect_env_details.py index 30b6ebc9f3..1d443795d2 100644 --- a/tests/collect_env_details.py +++ b/tests/collect_env_details.py @@ -10,7 +10,6 @@ import re import sys import numpy -import tensorboard import torch import tqdm @@ -61,7 +60,6 @@ def info_packages(): "pyTorch_version": torch.__version__, 'pyTorch_debug': torch.version.debug, 'pytorch-lightning': pytorch_lightning.__version__, - 'tensorboard': tensorboard.__version__, 'tqdm': tqdm.__version__, } diff --git a/tests/loggers/test_tensorboard.py b/tests/loggers/test_tensorboard.py index 0c28829013..dc9ff6dc0f 100644 --- a/tests/loggers/test_tensorboard.py +++ b/tests/loggers/test_tensorboard.py @@ -6,6 +6,7 @@ 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 @@ -34,17 +35,23 @@ def test_tensorboard_hparams_reload(tmpdir): # verify artifacts assert len(os.listdir(os.path.join(folder_path, "checkpoints"))) == 1 - # - # # verify tb logs - # event_acc = EventAccumulator(folder_path) - # event_acc.Reload() - # - # hparams_data = b'\x12\x84\x01"\x0b\n\tdrop_prob"\x0c\n\nbatch_size"\r\n\x0bin_features"' \ - # b'\x0f\n\rlearning_rate"\x10\n\x0eoptimizer_name"\x0b\n\tdata_root"\x0e\n' \ - # b'\x0cout_features"\x0c\n\nhidden_dim"\x04\n\x02b1"\x04\n\x02b2' - # - # assert event_acc.summary_metadata['_hparams_/experiment'].plugin_data.plugin_name == 'hparams' - # assert event_acc.summary_metadata['_hparams_/experiment'].plugin_data.content == hparams_data + + # verify tb logs + event_acc = EventAccumulator(folder_path) + event_acc.Reload() + + data_pt_1_5 = b'\x12\x93\x01"\x0b\n\tdrop_prob"\x0c\n\nbatch_size"\r\n\x0bin_features"\x0f\n\rlearning_rate"' \ + b'\x10\n\x0eoptimizer_name"\x0b\n\tdata_root"\x0e\n\x0cout_features"\x0c\n\nhidden_dim"' \ + b'\x04\n\x02b1"\x04\n\x02b2*\r\n\x0b\x12\thp_metric' + data_pt_1_6 = b'\x12\xa7\x01"\r\n\tdrop_prob \x03"\x0e\n\nbatch_size \x03"\x0f\n\x0bin_features \x03"' \ + b'\x11\n\rlearning_rate \x03"\x12\n\x0eoptimizer_name \x01"\r\n\tdata_root \x01"' \ + b'\x10\n\x0cout_features \x03"\x0e\n\nhidden_dim \x03"\x06\n\x02b1 \x03"' \ + b'\x06\n\x02b2 \x03*\r\n\x0b\x12\thp_metric' + + hparams_data = data_pt_1_6 if LooseVersion(torch.__version__) >= LooseVersion("1.6.0") else data_pt_1_5 + + assert event_acc.summary_metadata['_hparams_/experiment'].plugin_data.plugin_name == 'hparams' + assert event_acc.summary_metadata['_hparams_/experiment'].plugin_data.content == hparams_data def test_tensorboard_automatic_versioning(tmpdir):