-
Notifications
You must be signed in to change notification settings - Fork 1.3k
v0.5 to v0.6 migration guide
Wenqi Li edited this page Jul 9, 2021
·
13 revisions
In MONAI v0.6, we enhanced the design of metrics and postprocessing transforms to provide more flexible and advanced features, which, in the meantime, brought some slightly breaking changes.
Check What's new in 0.6 for more details of the new features.
To help users smoothly migrate the existing code from MONAI v0.5 to v0.6, this document shows the detailed steps with example code.
- After model forward and loss backward, to independently apply postprocessing transforms for every single data in a batch, need to execute
decollate_batchto convert the batch Tensor to a list of Tensors. - Currently, all the MONAI postprocessing transforms are updated to handle
channel-firstTensor instead ofbatch-firstTensor. So both the preprocessing transforms and postprocessing transforms handle the same data shape. Just execute postprocessing transform for every items of the list. - As all the postprocessing transforms expect Tensor type input, in order to ensure the data after
decollate_batchis Tensor, suggest to addToTensororToTensordtransform. - Use
from_engine()utility to extract expected data from the decollated list, setfirst=Truefor scalar values. {placeholder}
- Support list of
channel-firstTensors as input. - Support data parallel in multi-GPUs or multi-nodes cases. {placeholder}
{placeholder}
{placeholder}
{placeholder}