monai-deploy-app-sdk icon indicating copy to clipboard operation
monai-deploy-app-sdk copied to clipboard

[BUG] Unable to run ai_unetr_seg_app due to missing traced model

Open kavmar opened this issue 11 months ago • 3 comments

Hi,

it is not possible to run the ai_unetr_seg_app example, because provided model is not traced. When I get the model from Model Zoo large_files.yml:

"https://developer.download.nvidia.com/assets/Clara/monai/tutorials/model_zoo/model_swin_unetr_btcv_segmentation_v1.pt"

I am hitting an exception:

monai.deploy.exceptions.ItemNotExistsError: A predictor of the model is not set.

Please kindly provide a TorchScript model to test the application.

Thanks

kavmar avatar Jan 06 '25 12:01 kavmar

This example app is fairly old now, I recall there was an issue when scripting/tracing the model and maybe the reason why a TorchScript model file is no in the MONAI Model Zoo.

We have two options:

  • Try to trace/script the model again
  • Create a custom inference operator based off of the base class, and explicitly loads up the Torch model in the application code (the built-in Model Factory is limited to loading the TrochScript models and model folder for the Triton Inference service)

Loading Torch model is straightforward, and I will look to expand the supported Model format in the Model Factory.

MMelQin avatar Jan 06 '25 19:01 MMelQin

@MMelQin @kavmar. I'll add a torchscript model to test the app - no reason why this shouldn't exist.

cvbourne avatar Apr 25 '25 15:04 cvbourne

@MMelQin @kavmar https://github.com/Project-MONAI/model-zoo/pull/747

cvbourne avatar Apr 25 '25 18:04 cvbourne