Skip to content

Commit

Permalink
resolved #285
Browse files Browse the repository at this point in the history
  • Loading branch information
hvgazula committed Mar 8, 2024
1 parent ed0d609 commit 8aa264e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nobrainer/processing/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def fit(
opt_args=None,
loss=losses.dice,
metrics=metrics.dice,
callbacks=None
):
"""Train a segmentation model"""
# TODO: check validity of datasets
Expand Down Expand Up @@ -82,7 +83,12 @@ def _compile():
_compile()
self.model_.summary()

callbacks = []
if callbacks is not None and not isinstance(callbacks, list):
raise AttributeError('Callbacks must be either of type list or None')

if callbacks is None:
callbacks = []

if self.checkpoint_tracker:
callbacks.append(self.checkpoint_tracker)
self.model_.fit(
Expand Down

0 comments on commit 8aa264e

Please sign in to comment.