2020-10-13 11:18:07 +00:00
|
|
|
# Copyright The PyTorch Lightning team.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2020-03-03 01:49:14 +00:00
|
|
|
import pickle
|
2021-01-10 12:30:06 +00:00
|
|
|
from argparse import Namespace
|
2021-09-17 18:12:54 +00:00
|
|
|
from copy import deepcopy
|
|
|
|
from typing import Any, Dict, Optional
|
2021-07-13 09:36:36 +00:00
|
|
|
from unittest.mock import MagicMock, patch
|
2020-03-03 01:49:14 +00:00
|
|
|
|
2020-04-08 12:35:47 +00:00
|
|
|
import numpy as np
|
2021-07-13 09:36:36 +00:00
|
|
|
import pytest
|
2021-09-17 18:12:54 +00:00
|
|
|
import torch
|
2020-04-08 12:35:47 +00:00
|
|
|
|
2020-03-03 01:49:14 +00:00
|
|
|
from pytorch_lightning import Trainer
|
2021-01-10 12:30:06 +00:00
|
|
|
from pytorch_lightning.loggers import LightningLoggerBase, LoggerCollection, TensorBoardLogger
|
|
|
|
from pytorch_lightning.loggers.base import DummyExperiment, DummyLogger
|
2021-09-17 18:12:54 +00:00
|
|
|
from pytorch_lightning.utilities.exceptions import MisconfigurationException
|
2022-02-02 22:29:01 +00:00
|
|
|
from pytorch_lightning.utilities.logger import _convert_params, _sanitize_params
|
2022-02-07 08:09:55 +00:00
|
|
|
from pytorch_lightning.utilities.rank_zero import rank_zero_only
|
2021-09-17 18:12:54 +00:00
|
|
|
from tests.helpers.boring_model import BoringDataModule, BoringModel
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_logger_collection():
|
|
|
|
mock1 = MagicMock()
|
|
|
|
mock2 = MagicMock()
|
|
|
|
|
|
|
|
logger = LoggerCollection([mock1, mock2])
|
|
|
|
|
|
|
|
assert logger[0] == mock1
|
|
|
|
assert logger[1] == mock2
|
|
|
|
|
|
|
|
assert logger.experiment[0] == mock1.experiment
|
|
|
|
assert logger.experiment[1] == mock2.experiment
|
|
|
|
|
2020-07-29 21:53:02 +00:00
|
|
|
assert logger.save_dir is None
|
|
|
|
|
2021-07-26 11:37:35 +00:00
|
|
|
logger.update_agg_funcs({"test": np.mean}, np.sum)
|
|
|
|
mock1.update_agg_funcs.assert_called_once_with({"test": np.mean}, np.sum)
|
|
|
|
mock2.update_agg_funcs.assert_called_once_with({"test": np.mean}, np.sum)
|
2020-07-29 21:53:02 +00:00
|
|
|
|
2022-02-18 02:54:33 +00:00
|
|
|
logger.log_metrics(metrics={"test": 2.0}, step=4)
|
|
|
|
mock1.log_metrics.assert_called_once_with(metrics={"test": 2.0}, step=4)
|
|
|
|
mock2.log_metrics.assert_called_once_with(metrics={"test": 2.0}, step=4)
|
2020-07-29 21:53:02 +00:00
|
|
|
|
2021-09-20 22:00:09 +00:00
|
|
|
logger.finalize("success")
|
|
|
|
mock1.finalize.assert_called_once()
|
|
|
|
mock2.finalize.assert_called_once()
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
|
2021-12-23 00:35:38 +00:00
|
|
|
def test_logger_collection_unique_names():
|
|
|
|
unique_name = "name1"
|
|
|
|
logger1 = CustomLogger(name=unique_name)
|
|
|
|
logger2 = CustomLogger(name=unique_name)
|
|
|
|
|
|
|
|
logger = LoggerCollection([logger1, logger2])
|
|
|
|
|
|
|
|
assert logger.name == unique_name
|
|
|
|
|
|
|
|
|
|
|
|
def test_logger_collection_names_order():
|
|
|
|
loggers = [CustomLogger(name=n) for n in ("name1", "name2", "name1", "name3")]
|
|
|
|
logger = LoggerCollection(loggers)
|
|
|
|
assert logger.name == f"{loggers[0].name}_{loggers[1].name}_{loggers[3].name}"
|
|
|
|
|
|
|
|
|
|
|
|
def test_logger_collection_unique_versions():
|
|
|
|
unique_version = "1"
|
|
|
|
logger1 = CustomLogger(version=unique_version)
|
|
|
|
logger2 = CustomLogger(version=unique_version)
|
|
|
|
|
|
|
|
logger = LoggerCollection([logger1, logger2])
|
|
|
|
|
|
|
|
assert logger.version == unique_version
|
|
|
|
|
|
|
|
|
|
|
|
def test_logger_collection_versions_order():
|
|
|
|
loggers = [CustomLogger(version=v) for v in ("1", "2", "1", "3")]
|
|
|
|
logger = LoggerCollection(loggers)
|
|
|
|
assert logger.version == f"{loggers[0].version}_{loggers[1].version}_{loggers[3].version}"
|
|
|
|
|
|
|
|
|
2020-03-03 01:49:14 +00:00
|
|
|
class CustomLogger(LightningLoggerBase):
|
2021-12-23 00:35:38 +00:00
|
|
|
def __init__(self, experiment: str = "test", name: str = "name", version: str = "1"):
|
2020-03-03 01:49:14 +00:00
|
|
|
super().__init__()
|
2021-12-23 00:35:38 +00:00
|
|
|
self._experiment = experiment
|
|
|
|
self._name = name
|
|
|
|
self._version = version
|
2020-03-03 01:49:14 +00:00
|
|
|
self.hparams_logged = None
|
2021-01-10 12:30:06 +00:00
|
|
|
self.metrics_logged = {}
|
2020-03-03 01:49:14 +00:00
|
|
|
self.finalized = False
|
2021-05-27 18:15:02 +00:00
|
|
|
self.after_save_checkpoint_called = False
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def experiment(self):
|
2021-12-23 00:35:38 +00:00
|
|
|
return self._experiment
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
@rank_zero_only
|
|
|
|
def log_hyperparams(self, params):
|
|
|
|
self.hparams_logged = params
|
|
|
|
|
|
|
|
@rank_zero_only
|
|
|
|
def log_metrics(self, metrics, step):
|
|
|
|
self.metrics_logged = metrics
|
|
|
|
|
|
|
|
@rank_zero_only
|
|
|
|
def finalize(self, status):
|
|
|
|
self.finalized_status = status
|
|
|
|
|
2020-07-05 23:57:22 +00:00
|
|
|
@property
|
|
|
|
def save_dir(self) -> Optional[str]:
|
2021-09-06 12:49:09 +00:00
|
|
|
"""Return the root directory where experiment logs get saved, or `None` if the logger does not save data
|
|
|
|
locally."""
|
2020-07-05 23:57:22 +00:00
|
|
|
return None
|
|
|
|
|
2020-03-03 01:49:14 +00:00
|
|
|
@property
|
|
|
|
def name(self):
|
2021-12-23 00:35:38 +00:00
|
|
|
return self._name
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def version(self):
|
2021-12-23 00:35:38 +00:00
|
|
|
return self._version
|
2020-03-03 01:49:14 +00:00
|
|
|
|
2021-05-27 18:15:02 +00:00
|
|
|
def after_save_checkpoint(self, checkpoint_callback):
|
|
|
|
self.after_save_checkpoint_called = True
|
|
|
|
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
def test_custom_logger(tmpdir):
|
2021-01-10 12:30:06 +00:00
|
|
|
class CustomModel(BoringModel):
|
|
|
|
def training_step(self, batch, batch_idx):
|
|
|
|
output = self.layer(batch)
|
|
|
|
loss = self.loss(batch, output)
|
2021-07-26 11:37:35 +00:00
|
|
|
self.log("train_loss", loss)
|
2021-01-10 12:30:06 +00:00
|
|
|
return {"loss": loss}
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
logger = CustomLogger()
|
2021-01-10 12:30:06 +00:00
|
|
|
model = CustomModel()
|
2021-07-26 11:37:35 +00:00
|
|
|
trainer = Trainer(max_steps=2, log_every_n_steps=1, logger=logger, default_root_dir=tmpdir)
|
2021-01-12 00:36:48 +00:00
|
|
|
trainer.fit(model)
|
2021-05-04 10:50:56 +00:00
|
|
|
assert trainer.state.finished, f"Training failed with {trainer.state}"
|
2020-03-03 01:49:14 +00:00
|
|
|
assert logger.metrics_logged != {}
|
2021-05-27 18:15:02 +00:00
|
|
|
assert logger.after_save_checkpoint_called
|
2020-03-03 01:49:14 +00:00
|
|
|
assert logger.finalized_status == "success"
|
|
|
|
|
|
|
|
|
|
|
|
def test_multiple_loggers(tmpdir):
|
2021-01-10 12:30:06 +00:00
|
|
|
class CustomModel(BoringModel):
|
|
|
|
def training_step(self, batch, batch_idx):
|
|
|
|
output = self.layer(batch)
|
|
|
|
loss = self.loss(batch, output)
|
2021-07-26 11:37:35 +00:00
|
|
|
self.log("train_loss", loss)
|
2021-01-10 12:30:06 +00:00
|
|
|
return {"loss": loss}
|
|
|
|
|
|
|
|
model = CustomModel()
|
2020-03-03 01:49:14 +00:00
|
|
|
logger1 = CustomLogger()
|
|
|
|
logger2 = CustomLogger()
|
|
|
|
|
2021-07-26 11:37:35 +00:00
|
|
|
trainer = Trainer(max_steps=2, log_every_n_steps=1, logger=[logger1, logger2], default_root_dir=tmpdir)
|
2021-01-12 00:36:48 +00:00
|
|
|
trainer.fit(model)
|
2021-05-04 10:50:56 +00:00
|
|
|
assert trainer.state.finished, f"Training failed with {trainer.state}"
|
2020-03-03 01:49:14 +00:00
|
|
|
|
2021-12-17 18:40:56 +00:00
|
|
|
assert logger1.hparams_logged is None
|
2020-03-03 01:49:14 +00:00
|
|
|
assert logger1.metrics_logged != {}
|
|
|
|
assert logger1.finalized_status == "success"
|
|
|
|
|
2021-12-17 18:40:56 +00:00
|
|
|
assert logger2.hparams_logged is None
|
2020-03-03 01:49:14 +00:00
|
|
|
assert logger2.metrics_logged != {}
|
|
|
|
assert logger2.finalized_status == "success"
|
|
|
|
|
|
|
|
|
|
|
|
def test_multiple_loggers_pickle(tmpdir):
|
|
|
|
"""Verify that pickling trainer with multiple loggers works."""
|
|
|
|
|
|
|
|
logger1 = CustomLogger()
|
|
|
|
logger2 = CustomLogger()
|
|
|
|
|
2021-07-26 11:37:35 +00:00
|
|
|
trainer = Trainer(logger=[logger1, logger2])
|
2020-03-03 01:49:14 +00:00
|
|
|
pkl_bytes = pickle.dumps(trainer)
|
|
|
|
trainer2 = pickle.loads(pkl_bytes)
|
2022-02-26 00:01:04 +00:00
|
|
|
for logger in trainer2.loggers:
|
|
|
|
logger.log_metrics({"acc": 1.0}, 0)
|
2020-03-03 01:49:14 +00:00
|
|
|
|
2022-02-26 00:01:04 +00:00
|
|
|
for logger in trainer2.loggers:
|
|
|
|
assert logger.metrics_logged == {"acc": 1.0}
|
2020-03-03 01:49:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_adding_step_key(tmpdir):
|
2021-01-10 12:30:06 +00:00
|
|
|
class CustomTensorBoardLogger(TensorBoardLogger):
|
2021-04-27 20:23:55 +00:00
|
|
|
def __init__(self, *args, **kwargs) -> None:
|
2021-01-10 12:30:06 +00:00
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.logged_step = 0
|
2020-03-03 01:49:14 +00:00
|
|
|
|
2021-01-10 12:30:06 +00:00
|
|
|
def log_metrics(self, metrics, step):
|
2020-03-03 01:49:14 +00:00
|
|
|
if "val_acc" in metrics:
|
2021-01-10 12:30:06 +00:00
|
|
|
assert step == self.logged_step
|
|
|
|
|
|
|
|
super().log_metrics(metrics, step)
|
|
|
|
|
|
|
|
class CustomModel(BoringModel):
|
|
|
|
def training_epoch_end(self, outputs):
|
|
|
|
self.logger.logged_step += 1
|
2021-02-06 11:07:26 +00:00
|
|
|
self.log_dict({"step": self.logger.logged_step, "train_acc": self.logger.logged_step / 10})
|
2021-01-10 12:30:06 +00:00
|
|
|
|
|
|
|
def validation_epoch_end(self, outputs):
|
|
|
|
self.logger.logged_step += 1
|
2021-02-06 11:07:26 +00:00
|
|
|
self.log_dict({"step": self.logger.logged_step, "val_acc": self.logger.logged_step / 10})
|
2021-01-10 12:30:06 +00:00
|
|
|
|
|
|
|
model = CustomModel()
|
2020-05-01 14:43:58 +00:00
|
|
|
trainer = Trainer(
|
2020-06-01 15:00:32 +00:00
|
|
|
max_epochs=3,
|
2021-01-10 12:30:06 +00:00
|
|
|
logger=CustomTensorBoardLogger(save_dir=tmpdir),
|
2020-04-10 16:02:59 +00:00
|
|
|
default_root_dir=tmpdir,
|
2020-06-17 17:42:28 +00:00
|
|
|
limit_train_batches=0.1,
|
2020-06-17 12:03:28 +00:00
|
|
|
limit_val_batches=0.1,
|
2020-03-20 19:51:14 +00:00
|
|
|
num_sanity_val_steps=0,
|
2020-03-03 01:49:14 +00:00
|
|
|
)
|
|
|
|
trainer.fit(model)
|
2020-04-08 12:35:47 +00:00
|
|
|
|
|
|
|
|
2020-12-05 21:00:31 +00:00
|
|
|
def test_dummyexperiment_support_indexing():
|
2021-07-26 11:37:35 +00:00
|
|
|
"""Test that the DummyExperiment can imitate indexing the experiment in a LoggerCollection."""
|
2020-12-05 21:00:31 +00:00
|
|
|
experiment = DummyExperiment()
|
|
|
|
assert experiment[0] == experiment
|
|
|
|
|
|
|
|
|
|
|
|
def test_dummylogger_support_indexing():
|
2021-07-26 11:37:35 +00:00
|
|
|
"""Test that the DummyLogger can imitate indexing of a LoggerCollection."""
|
2020-12-05 21:00:31 +00:00
|
|
|
logger = DummyLogger()
|
|
|
|
assert logger[0] == logger
|
|
|
|
|
|
|
|
|
2021-10-29 07:22:59 +00:00
|
|
|
def test_dummylogger_empty_iterable():
|
|
|
|
"""Test that DummyLogger represents an empty iterable."""
|
|
|
|
logger = DummyLogger()
|
|
|
|
for _ in logger:
|
|
|
|
assert False
|
|
|
|
|
|
|
|
|
2021-03-09 23:18:38 +00:00
|
|
|
def test_dummylogger_noop_method_calls():
|
2021-07-26 11:37:35 +00:00
|
|
|
"""Test that the DummyLogger methods can be called with arbitrary arguments."""
|
2021-03-09 23:18:38 +00:00
|
|
|
logger = DummyLogger()
|
|
|
|
logger.log_hyperparams("1", 2, three="three")
|
|
|
|
logger.log_metrics("1", 2, three="three")
|
|
|
|
|
|
|
|
|
2021-12-03 17:54:05 +00:00
|
|
|
def test_dummyexperiment_support_item_assignment():
|
|
|
|
"""Test that the DummyExperiment supports item assignment."""
|
|
|
|
experiment = DummyExperiment()
|
|
|
|
experiment["variable"] = "value"
|
|
|
|
assert experiment["variable"] != "value" # this is only a stateless mock experiment
|
|
|
|
|
|
|
|
|
2020-11-19 07:52:48 +00:00
|
|
|
def test_np_sanitization():
|
|
|
|
class CustomParamsLogger(CustomLogger):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self.logged_params = None
|
|
|
|
|
|
|
|
@rank_zero_only
|
|
|
|
def log_hyperparams(self, params):
|
2022-02-02 22:29:01 +00:00
|
|
|
params = _convert_params(params)
|
|
|
|
params = _sanitize_params(params)
|
2020-11-19 07:52:48 +00:00
|
|
|
self.logged_params = params
|
|
|
|
|
|
|
|
logger = CustomParamsLogger()
|
|
|
|
np_params = {
|
|
|
|
"np.bool_": np.bool_(1),
|
|
|
|
"np.byte": np.byte(2),
|
|
|
|
"np.intc": np.intc(3),
|
|
|
|
"np.int_": np.int_(4),
|
|
|
|
"np.longlong": np.longlong(5),
|
|
|
|
"np.single": np.single(6.0),
|
|
|
|
"np.double": np.double(8.9),
|
|
|
|
"np.csingle": np.csingle(7 + 2j),
|
|
|
|
"np.cdouble": np.cdouble(9 + 4j),
|
|
|
|
}
|
|
|
|
sanitized_params = {
|
|
|
|
"np.bool_": True,
|
|
|
|
"np.byte": 2,
|
|
|
|
"np.intc": 3,
|
|
|
|
"np.int_": 4,
|
|
|
|
"np.longlong": 5,
|
|
|
|
"np.single": 6.0,
|
|
|
|
"np.double": 8.9,
|
|
|
|
"np.csingle": "(7+2j)",
|
|
|
|
"np.cdouble": "(9+4j)",
|
|
|
|
}
|
|
|
|
logger.log_hyperparams(Namespace(**np_params))
|
|
|
|
assert logger.logged_params == sanitized_params
|
2021-07-13 09:36:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("logger", [True, False])
|
|
|
|
@patch("pytorch_lightning.loggers.tensorboard.TensorBoardLogger.log_hyperparams")
|
|
|
|
def test_log_hyperparams_being_called(log_hyperparams_mock, tmpdir, logger):
|
|
|
|
class TestModel(BoringModel):
|
|
|
|
def __init__(self, param_one, param_two):
|
|
|
|
super().__init__()
|
|
|
|
self.save_hyperparameters(logger=logger)
|
|
|
|
|
|
|
|
model = TestModel("pytorch", "lightning")
|
|
|
|
trainer = Trainer(
|
2021-07-26 11:37:35 +00:00
|
|
|
default_root_dir=tmpdir, max_epochs=1, limit_train_batches=0.1, limit_val_batches=0.1, num_sanity_val_steps=0
|
2021-07-13 09:36:36 +00:00
|
|
|
)
|
|
|
|
trainer.fit(model)
|
|
|
|
|
|
|
|
if logger:
|
|
|
|
log_hyperparams_mock.assert_called()
|
|
|
|
else:
|
|
|
|
log_hyperparams_mock.assert_not_called()
|
2021-09-17 18:12:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
@patch("pytorch_lightning.loggers.tensorboard.TensorBoardLogger.log_hyperparams")
|
|
|
|
def test_log_hyperparams_key_collision(log_hyperparams_mock, tmpdir):
|
|
|
|
class TestModel(BoringModel):
|
|
|
|
def __init__(self, hparams: Dict[str, Any]) -> None:
|
|
|
|
super().__init__()
|
|
|
|
self.save_hyperparameters(hparams)
|
|
|
|
|
|
|
|
class TestDataModule(BoringDataModule):
|
|
|
|
def __init__(self, hparams: Dict[str, Any]) -> None:
|
|
|
|
super().__init__()
|
|
|
|
self.save_hyperparameters(hparams)
|
|
|
|
|
|
|
|
class _Test:
|
|
|
|
...
|
|
|
|
|
|
|
|
same_params = {1: 1, "2": 2, "three": 3.0, "test": _Test(), "4": torch.tensor(4)}
|
|
|
|
model = TestModel(same_params)
|
|
|
|
dm = TestDataModule(same_params)
|
|
|
|
|
|
|
|
trainer = Trainer(
|
|
|
|
default_root_dir=tmpdir,
|
|
|
|
max_epochs=1,
|
|
|
|
limit_train_batches=0.1,
|
|
|
|
limit_val_batches=0.1,
|
|
|
|
num_sanity_val_steps=0,
|
2021-10-12 07:55:07 +00:00
|
|
|
enable_checkpointing=False,
|
2021-09-25 05:53:31 +00:00
|
|
|
enable_progress_bar=False,
|
2021-10-13 11:50:54 +00:00
|
|
|
enable_model_summary=False,
|
2021-09-17 18:12:54 +00:00
|
|
|
)
|
|
|
|
# there should be no exceptions raised for the same key/value pair in the hparams of both
|
|
|
|
# the lightning module and data module
|
|
|
|
trainer.fit(model)
|
|
|
|
|
|
|
|
obj_params = deepcopy(same_params)
|
|
|
|
obj_params["test"] = _Test()
|
|
|
|
model = TestModel(same_params)
|
|
|
|
dm = TestDataModule(obj_params)
|
|
|
|
trainer.fit(model)
|
|
|
|
|
|
|
|
diff_params = deepcopy(same_params)
|
|
|
|
diff_params.update({1: 0, "test": _Test()})
|
|
|
|
model = TestModel(same_params)
|
|
|
|
dm = TestDataModule(diff_params)
|
|
|
|
trainer = Trainer(
|
|
|
|
default_root_dir=tmpdir,
|
|
|
|
max_epochs=1,
|
|
|
|
limit_train_batches=0.1,
|
|
|
|
limit_val_batches=0.1,
|
|
|
|
num_sanity_val_steps=0,
|
2021-10-12 07:55:07 +00:00
|
|
|
enable_checkpointing=False,
|
2021-09-25 05:53:31 +00:00
|
|
|
enable_progress_bar=False,
|
2021-10-13 11:50:54 +00:00
|
|
|
enable_model_summary=False,
|
2021-09-17 18:12:54 +00:00
|
|
|
)
|
|
|
|
with pytest.raises(MisconfigurationException, match="Error while merging hparams"):
|
|
|
|
trainer.fit(model, dm)
|
|
|
|
|
|
|
|
tensor_params = deepcopy(same_params)
|
|
|
|
tensor_params.update({"4": torch.tensor(3)})
|
|
|
|
model = TestModel(same_params)
|
|
|
|
dm = TestDataModule(tensor_params)
|
|
|
|
trainer = Trainer(
|
|
|
|
default_root_dir=tmpdir,
|
|
|
|
max_epochs=1,
|
|
|
|
limit_train_batches=0.1,
|
|
|
|
limit_val_batches=0.1,
|
|
|
|
num_sanity_val_steps=0,
|
2021-10-12 07:55:07 +00:00
|
|
|
enable_checkpointing=False,
|
2021-09-25 05:53:31 +00:00
|
|
|
enable_progress_bar=False,
|
2021-10-13 11:50:54 +00:00
|
|
|
enable_model_summary=False,
|
2021-09-17 18:12:54 +00:00
|
|
|
)
|
|
|
|
with pytest.raises(MisconfigurationException, match="Error while merging hparams"):
|
|
|
|
trainer.fit(model, dm)
|