Skip to content

Commit

Permalink
3539 Remove decollate warning (#3545)
Browse files Browse the repository at this point in the history
* [DLMED] remove warning

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix typo

Signed-off-by: Nic Ma <nma@nvidia.com>
  • Loading branch information
Nic-Ma authored Dec 24, 2021
1 parent 7f23f38 commit 29bc93b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions monai/engines/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from monai.config import IgniteInfo
from monai.engines.utils import IterationEvents, default_metric_cmp_fn, default_prepare_batch
from monai.transforms import Decollated, Transform
from monai.transforms import Decollated
from monai.utils import ensure_tuple, is_scalar, min_version, optional_import

from .utils import engine_apply_transform
Expand Down Expand Up @@ -186,8 +186,8 @@ def set_sampler_epoch(engine: Engine):
self._register_decollate()

if postprocessing is not None:
if not decollate and isinstance(postprocessing, Transform):
warnings.warn("MONAI transforms expect `channel-first` data, `decollate=False` may not work here.")
# tips: if `decollate=False` and `postprocessing` is MONAI transforms, it may not work well
# because all the MONAI transforms expect `channel-first` data
self._register_postprocessing(postprocessing)
if key_metric is not None:
self._register_metrics(key_metric, additional_metrics)
Expand Down

0 comments on commit 29bc93b

Please sign in to comment.