зеркало из https://github.com/microsoft/torchgeo.git
Trainers: fix support for non-TensorBoardLogger (#1145)
* Trainers: fix support for CSVLogger
* No need to check truthiness of attr
* Revert "No need to check truthiness of attr"
This reverts commit 450df6c53c
.
This commit is contained in:
Родитель
0a266b2a01
Коммит
6b1c2cc9cc
|
@ -192,6 +192,7 @@ class ClassificationTask(pl.LightningModule):
|
|||
and hasattr(self.trainer, "datamodule")
|
||||
and self.logger
|
||||
and hasattr(self.logger, "experiment")
|
||||
and hasattr(self.logger.experiment, "add_figure")
|
||||
):
|
||||
try:
|
||||
datamodule = self.trainer.datamodule
|
||||
|
@ -376,6 +377,7 @@ class MultiLabelClassificationTask(ClassificationTask):
|
|||
and hasattr(self.trainer, "datamodule")
|
||||
and self.logger
|
||||
and hasattr(self.logger, "experiment")
|
||||
and hasattr(self.logger.experiment, "add_figure")
|
||||
):
|
||||
try:
|
||||
datamodule = self.trainer.datamodule
|
||||
|
|
|
@ -230,6 +230,7 @@ class ObjectDetectionTask(pl.LightningModule):
|
|||
and hasattr(self.trainer, "datamodule")
|
||||
and self.logger
|
||||
and hasattr(self.logger, "experiment")
|
||||
and hasattr(self.logger.experiment, "add_figure")
|
||||
):
|
||||
try:
|
||||
datamodule = self.trainer.datamodule
|
||||
|
|
|
@ -149,6 +149,7 @@ class RegressionTask(pl.LightningModule):
|
|||
and hasattr(self.trainer, "datamodule")
|
||||
and self.logger
|
||||
and hasattr(self.logger, "experiment")
|
||||
and hasattr(self.logger.experiment, "add_figure")
|
||||
):
|
||||
try:
|
||||
datamodule = self.trainer.datamodule
|
||||
|
|
|
@ -202,6 +202,7 @@ class SemanticSegmentationTask(pl.LightningModule):
|
|||
and hasattr(self.trainer, "datamodule")
|
||||
and self.logger
|
||||
and hasattr(self.logger, "experiment")
|
||||
and hasattr(self.logger.experiment, "add_figure")
|
||||
):
|
||||
try:
|
||||
datamodule = self.trainer.datamodule
|
||||
|
|
Загрузка…
Ссылка в новой задаче