Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Oct 3, 2020
1 parent 1aa46f9 commit 4dfd824
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/models/test_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def test_model_checkpoint_format_checkpoint_name(tmpdir):
ckpt_name = ModelCheckpoint(monitor='early_stop_on', filepath='').format_checkpoint_name(5, 4, {})
assert ckpt_name == 'epoch=5-step=4.ckpt'
# CWD
ckpt_name = ModelCheckpoint(monitor='early_stop_on', filepath='../callbacks').format_checkpoint_name(3, 4, {})
assert Path(ckpt_name) == Path('../callbacks') / 'epoch=3-step=4.ckpt'
ckpt_name = ModelCheckpoint(monitor='early_stop_on', filepath='../').format_checkpoint_name(3, 4, {})
assert Path(ckpt_name).absolute() == (Path('..') / 'epoch=3-step=4.ckpt').absolute()
# dir does not exist so it is used as filename
filepath = tmpdir / 'dir'
ckpt_name = ModelCheckpoint(monitor='early_stop_on', filepath=filepath, prefix='test').format_checkpoint_name(3, 4, {})
Expand Down Expand Up @@ -375,7 +375,7 @@ def test_default_checkpoint_behavior(tmpdir):
assert len(trainer.dev_debugger.checkpoint_callback_history) == 3

# make sure the checkpoint we saved has the metric in the name
ckpts = os.listdir(os.path.join(tmpdir, '../callbacks/lightning_logs', 'version_0', 'checkpoints'))
ckpts = os.listdir(os.path.join(tmpdir, 'lightning_logs', 'version_0', 'checkpoints'))
assert len(ckpts) == 1
assert ckpts[0] == 'epoch=2-step=14.ckpt'

Expand Down

0 comments on commit 4dfd824

Please sign in to comment.