fix tensorboard version (#3132)

* tensorboard version

* WIP test tb hparams logs (#3040)

* optional

* req

* tensorboard>=2.2.0

* data

* data

* TB

Co-authored-by: Rosario Scalise <rosario@cs.washington.edu>
This commit is contained in:
Jirka Borovec 2020-09-15 23:48:48 +02:00 committed by GitHub
parent 6817701371
commit c64520e658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 21 deletions

View File

@ -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: |

View File

@ -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: |

View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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):