# Error when using Brain Tumor Segmentation(GLI)" model in MONAI Auto3DSeg

**URL:** <https://discourse.slicer.org/t/error-when-using-brain-tumor-segmentation-gli-model-in-monai-auto3dseg/38484>\
**Category:** Support\
**Tags:** monai-auto3dseg\
**Created:** [September 22, 2024, 2:04pm UTC](https://discourse.slicer.org/t/error-when-using-brain-tumor-segmentation-gli-model-in-monai-auto3dseg/38484 "2024-09-22T14:04:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clam\_keep](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/clam_keep/32/77991_2.png) [@clam\_keep](https://discourse.slicer.org/u/clam_keep)\
**Post date:** [September 22, 2024, 2:04pm UTC](https://discourse.slicer.org/t/error-when-using-brain-tumor-segmentation-gli-model-in-monai-auto3dseg/38484/1 "2024-09-22T14:04:36Z")

</div>

I was try to use the “Brain Tumor Segmentation(GLI)” model in the MONAI Auto3DSEG to create segmentations on my own MRdata. It do worked once and then keep failing.  
These are error messages:

Processing started  
Writing input file to C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume0.nrrd  
Writing input file to C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume1.nrrd  
Writing input file to C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume2.nrrd  
Writing input file to C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume3.nrrd  
Creating segmentations with MONAIAuto3DSeg AI…  
Auto3DSeg command: [‘C:/Users/zcs/AppData/Local/slicer.org/Slicer 5.7.0-2024-09-19/bin/…/bin\PythonSlicer.EXE’, ‘C:/Users/zcs/AppData/Local/slicer.org/Slicer 5.7.0-2024-09-19/slicer.org/Extensions-33018/MONAIAuto3DSeg/lib/Slicer-5.7/qt-scripted-modules\Scripts\auto3dseg\_segresnet\_inference.py’, ‘–model-file’, ‘C:\Users\zcs\.MONAIAuto3DSeg\models\brats-gli-v1.0.0\model.pt’, ‘–image-file’, ‘C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume0.nrrd’, ‘–result-file’, ‘C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/output-segmentation.nrrd’, ‘–image-file-2’, ‘C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume1.nrrd’, ‘–image-file-3’, ‘C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume2.nrrd’, ‘–image-file-4’, ‘C:/Users/zcs/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-09-21\_23+21+09.704/input-volume3.nrrd’]  
You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See [pytorch/SECURITY.md at main · pytorch/pytorch · GitHub](https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models) for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don’t have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.  
`apex.normalization.InstanceNorm3dNVFuser` is not installed properly, use nn.InstanceNorm3d instead.  
Model epoch 262 metric 0.8930580615997314  
Using crop\_foreground  
Using resample with resample\_resolution [1.0, 1.0, 1.0]  
Traceback (most recent call last):  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\transforms\transform.py”, line 140, in apply\_transform  
return [\_apply\_transform(transform, item, unpack\_items, lazy, overrides, log\_stats) for item in data]  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\transforms\transform.py”, line 140, in   
return [\_apply\_transform(transform, item, unpack\_items, lazy, overrides, log\_stats) for item in data]  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\transforms\transform.py”, line 98, in \_apply\_transform  
return transform(data, lazy=lazy) if isinstance(transform, LazyTrait) else transform(data)  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\transforms\io\dictionary.py”, line 162, in **call**  
data = self.\_loader(d[key], reader)  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\transforms\io\array.py”, line 282, in **call**  
img\_array, meta\_data = reader.get\_data(img)  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\data\image\_reader.py”, line 1343, in get\_data  
\_copy\_compatible\_dict(header, compatible\_meta)  
File “C:\Users\zcs\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-19\lib\Python\Lib\site-packages\monai\data\image\_reader.py”, line 129, in \_copy\_compatible\_dict  
raise RuntimeError(  
RuntimeError: affine matrix of all images should be the same for channel-wise concatenation. Got [[-4.57198656e-01 -1.03385621e-01 2.71376017e-03 1.41867333e+02]  
[-1.01093522e-01 4.44159679e-01 -1.10584093e-01 -1.02964030e+02]  
[3.02560651e-01 -1.50380787e+00 -6.31662069e+00 3.36919582e+01]  
[0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]] and [[-4.57248575e-01 -1.03391612e-01 2.71345400e-03 1.41872669e+02]  
[-1.01099258e-01 4.44208168e-01 -1.10596074e-01 -1.02986774e+02]  
[3.02538236e-01 -1.50374134e+00 -6.31632356e+00 3.36796764e+01]  
[0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]].

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
Processing failed with return code 1  
Cleaning up temporary folder.  
Processing failed after 4.64 seconds.

Processing finished.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 22, 2024, 4:14pm UTC](https://discourse.slicer.org/t/error-when-using-brain-tumor-segmentation-gli-model-in-monai-auto3dseg/38484/2 "2024-09-22T16:14:02Z")

</div>

Probably you just need to resample them to the same geometry using the Resample Image (BRAINS) module under registration. Use one of the volumes as the reference (probably the highest res one).

---

<div class="post-metadata">

**Author:** ![clam\_keep](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/clam_keep/32/77991_2.png) [@clam\_keep](https://discourse.slicer.org/u/clam_keep)\
**Post date:** [September 23, 2024, 7:40am UTC](https://discourse.slicer.org/t/error-when-using-brain-tumor-segmentation-gli-model-in-monai-auto3dseg/38484/3 "2024-09-23T07:40:34Z")

</div>

Thank you very much for the help. Your suggestions were very effective！
