From 099badbf5f818cb0f57c45301695feb8a3b3687a Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 8 Apr 2021 10:16:31 +0900 Subject: [PATCH] Fix csv extension check (#6436) Co-authored-by: Carlos Mocholi (cherry picked from commit 01b9cf8fdc117675029f5096470e14445276e607) --- CHANGELOG.md | 3 +++ pytorch_lightning/core/saving.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f24d11f9065af..8e889029814c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -185,6 +185,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Do not print top-k verbose log with `ModelCheckpoint(monitor=None)` ([#6109](https://github.com/PyTorchLightning/pytorch-lightning/pull/6109)) +- Fixed csv extension check ([#6436](https://github.com/PyTorchLightning/pytorch-lightning/pull/6436)) + + - Fixed `ModelCheckpoint(monitor=None, save_last=True)` not saving checkpoints ([#6136](https://github.com/PyTorchLightning/pytorch-lightning/pull/6136)) diff --git a/pytorch_lightning/core/saving.py b/pytorch_lightning/core/saving.py index 280eca55260a7..ffa9b0a1359ee 100644 --- a/pytorch_lightning/core/saving.py +++ b/pytorch_lightning/core/saving.py @@ -136,7 +136,7 @@ def load_from_checkpoint( if hparams_file is not None: extension = hparams_file.split('.')[-1] - if extension.lower() in ('csv'): + if extension.lower() == 'csv': hparams = load_hparams_from_tags_csv(hparams_file) elif extension.lower() in ('yml', 'yaml'): hparams = load_hparams_from_yaml(hparams_file)