mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Tensorboard path generalisation (#804)
* Allow experiment versions to be overridden by passing a string value. Allow experiment names to be empty, in which case no per-experiment subdirectory will be created and checkpoints will be saved in the directory given by the save_dir parameter. * Document tensorboard api changes * Review comment fixes plus fixed test failure for minimum requirements build * More format fixes from review
This commit is contained in:
@@ -294,6 +294,19 @@ def test_tensorboard_manual_versioning(tmpdir):
|
||||
assert logger.version == 1
|
||||
|
||||
|
||||
def test_tensorboard_named_version(tmpdir):
|
||||
"""Verify that manual versioning works for string versions, e.g. '2020-02-05-162402' """
|
||||
|
||||
tmpdir.mkdir("tb_versioning")
|
||||
expected_version = "2020-02-05-162402"
|
||||
|
||||
logger = TensorBoardLogger(save_dir=tmpdir, name="tb_versioning", version=expected_version)
|
||||
logger.log_hyperparams({"a": 1, "b": 2}) # Force data to be written
|
||||
|
||||
assert logger.version == expected_version
|
||||
# Could also test existence of the directory but this fails in the "minimum requirements" test setup
|
||||
|
||||
|
||||
@pytest.mark.parametrize("step_idx", [10, None])
|
||||
def test_tensorboard_log_metrics(tmpdir, step_idx):
|
||||
logger = TensorBoardLogger(tmpdir)
|
||||
|
||||
Reference in New Issue
Block a user