RuntimeError: Error Resize getting the most recently applied invertible transform Orientation #1035
Replies: 4 comments 3 replies
-
Hi @neerajamaha , based on the logs, the errors are caused by the inverse transform after prediction. The code tries to recover the prediction back to its original image space with invert transformation, those transform are determined accordingly by pre-transforms. It seems the Resize transform inverse has some issue, e.g., data orientation. |
Beta Was this translation helpful? Give feedback.
-
Hi @tangy5, I have encountered the same problem here. Could you please help me? Basically, I am trying to use my own pretrained model for auto-segmentation in MONAIlabel. The preprocessing, postprocessing, and sliding window inference methods worked very well in the conventional Jupyter Notebook approach. However, this same code does not work in MONAIlabel.
The terminal always stopped at the 'Invertd' step (invertible transform SpatialResample 139624824560896 != 139623799946544.). I have tried your suggestions, such as adding Orientationd(keys='img', axcodes='RAS') or using different MRI scans, but the process still corrupts. If I replace 'Invertd' with 'Restored(keys='pred', ref_image='image')', I get very weird results.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for post the question in monailabel repo as well @Hirriririir , I read through your logs and tried to find anything different with our prior apps and models. It's very likely the transforms' issues. First, if the problem is caused by the Invertd or Restored transforms, the error is probably caused by an incorrect reference pre-transform, as you defined a new transform group instead of using the pre-transform, since no meta info is saved. Except for this one, I did not find other wrong items. If this doesn't work, you could double-check the following as denugging reference.
Thanks, I believe once you figured out the way of using monailabel, you will love it. |
Beta Was this translation helpful? Give feedback.
-
you have saved the stat_dict with a different key.. https://github.com/Project-MONAI/MONAILabel/blob/main/monailabel/tasks/infer/basic_infer.py#L55 |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have trained a model for lung segmentation using MONAI Label, where inputs are MRI exams, and the model is a DeepEdit application. When I try to run inferences on a new lung MRI dataset for model validation, I am getting the following error:
I have gotten this error before but thought the issue was because I was trying to run an inference on an image that the model was already trained on, so there were duplicate IDs for the same exam. However, this current trained model has not been exposed to this new dataset, so I'm not sure what the issue is. Any help with this is appreciated!
Thank you so much,
Neeraja
Beta Was this translation helpful? Give feedback.
All reactions