Project-MONAI / model-zoo

MONAI Model Zoo that hosts models in the MONAI Bundle format.
Apache License 2.0
204 stars 69 forks source link

ImportError: 'IgniteInfo' from 'monai.utils' and Compatibility Issues with MONAI v1.4.0+ during Inference #714

Open rifshu opened 1 week ago

rifshu commented 1 week ago

Discussed in https://github.com/Project-MONAI/model-zoo/discussions/713

Originally posted by **rifshu** November 14, 2024 I'm encountering multiple issues when running inference using the MONAI bundle on a custom pipeline that includes RetinaNet-based object detection for 3D medical imaging (LUNA16 dataset). The issues seem to be related to the recent updates in MONAI (v1.4.0 and above). Below are the details: ImportError for IgniteInfo: When attempting to run inference using the MONAI bundle (python -m monai.bundle run --config_file configs/inference.json), I receive the following error: ImportError: cannot import name 'IgniteInfo' from 'monai.utils' Expected Behavior: The inference pipeline should run without errors using the pre-trained model and process the LUNA16 dataset to generate predictions. Actual Behavior: The pipeline fails to run due to IgniteInfo import errors, version incompatibilities with itkreader, and multiple deprecation warnings. What I've Tried: Updated all related packages (torch, pytorch-ignite, itk). changes in inference file: 1) "whether_raw_luna16": true 2) "dataset_dir": "..../subset0", Request for Help: I am relatively new to MONAI and would greatly appreciate a step-by-step guide on how to properly use a pre-trained model from MONAI to run inference on a dataset that I have stored locally on my system. Any guidance on setting up the configuration files, loading the model, and executing the inference pipeline would be incredibly helpful. Thank you in advance for your assistance!