Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tensorboard version #3132

Merged
merged 11 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci_test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,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: |
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ flake8-black
check-manifest
twine==1.13.0
scikit-image
black==19.10b0
black>=20.8b1
Borda marked this conversation as resolved.
Show resolved Hide resolved
pre-commit>=1.0

cloudpickle>=1.2
Expand Down
2 changes: 0 additions & 2 deletions tests/collect_env_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import sys

import numpy
import tensorboard
import torch
import tqdm

Expand Down Expand Up @@ -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__,
}

Expand Down
29 changes: 18 additions & 11 deletions tests/loggers/test_tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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
Expand Down Expand Up @@ -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):
Expand Down