Skip to content

Feedback about Monai bundle  #6647

@jabarragann

Description

@jabarragann

Hi,

I am a Ph.D. student working in the field of medical robotics. For the past few weeks, I have been learning about the Monai bundle specification to contribute a model to the Monai Zoo. The following issue summarizes the experience of going through the bundle's documentation as a beginner to Monai.

  • Firstly, I would say it was quite challenging to understand the main concept behind the Monai bundle. The main documentation page defines the monai.bundle as a module enabling "Python-based workflows via structured configurations" which didn't make much sense in the beginning.

In my opinion, one of the nicest things about Monai Bundle is the capability of building dynamic configuration files generated using Python expressions when used with the hybrid programming mode. However, this is barely mentioned in the documentation. I think the documentation overfocuses on writing complete scripts, such as the training.json, that are then run with the Monai bundle CLI. This gives the impression that the bundles are something very complicated to use. Adding some additional examples of simple configuration management could be useful for beginners. For instance, I have been relying lately on the bundle to manage all path-related variables for my training scripts, as observed here.

  • My second issue with the bundle is that it is not easy to apply multiple functions to the same variable. For instance, consider the following Python snippet:
    input_tensor = img_transforms(image).to(device)
    input_tensor = torch.unsqueeze(input_tensor, 0)

In the Python code is easy to re-apply additional functions to a previously declared variable such as input_tensor. When trying to translate the previous script into a bundle I ended with something like

inference:
  input_tensor: $@img_transforms(@image).to(@device)
  input_tensor1: $torch.unsqueeze(@inference#input_tensor0, 0) 

where the only solution is to create multiple copies of the original input_tensor variable, i.e., input_tensor1. This limits translating scripts into bundles.

Hope, these two ideas can improve future versions of Monai and its documentation!

Metadata

Metadata

Assignees

No one assigned

    Labels

    BundlesAnything related to bundles

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions