# Auto Segmentation error error in 'brats\_mri\_segmentation\_v0.3.8'

**URL:** <https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368>\
**Category:** Support\
**Created:** [November 22, 2022, 2:19am UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368 "2022-11-22T02:19:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)\
**Post date:** [November 22, 2022, 2:19am UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368/1 "2022-11-22T02:19:45Z")

</div>

Dear all members in 3d slicer

**Describe the bug**  
[2022-11-22 10:24:37,281] [19036] [MainThread] [ERROR] (uvicorn.error:119) - Traceback (most recent call last):  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py”, line 635, in lifespan  
async with self.lifespan\_context(app):  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py”, line 530, in **aenter**  
await self._router.startup()  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py”, line 612, in startup  
await handler()  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monailabel\app.py”, line 106, in startup\_event  
instance = app\_instance()  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monailabel\interfaces\utils\app.py”, line 51, in app\_instance  
app = c(app\_dir=app\_dir, studies=studies, conf=conf)  
File “C:\Users\AA\apps\monaibundle\main.py”, line 90, in **init**  
super(). **init** (  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monailabel\interfaces\app.py”, line 96, in **init**  
self.trainers = self.init\_trainers() if settings.MONAI\_LABEL\_TASKS\_TRAIN else {}  
File “C:\Users\AA\apps\monaibundle\main.py”, line 116, in init\_trainers  
t = BundleTrainTask(b, self.conf)  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monailabel\tasks\train\bundle.py”, line 83, in **init**  
self.bundle\_config.read\_config(self.bundle\_config\_path)  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monai\bundle\config\_parser.py”, line 300, in read\_config  
content.update(self.load\_config\_files(f, \*\*kwargs))  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monai\bundle\config\_parser.py”, line 403, in load\_config\_files  
for k, v in (cls.load\_config\_file(i, \*\*kwargs)).items():  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\site-packages\monai\bundle\config\_parser.py”, line 382, in load\_config\_file  
return json.load(f, \*\*kwargs)  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\json\_init.py”, line 293, in load  
return loads(fp.read(),  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\json\_init_.py”, line 346, in loads  
return \_default\_decoder.decode(s)  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode  
obj, end = self.raw\_decode(s, idx=\_w(s, 0).end())  
File “C:\Users\AA\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 353, in raw\_decode  
obj, end = self.scan\_once(s, idx)  
json.decoder.JSONDecodeError: Expecting ‘,’ delimiter: line 63 column 43 (char 1947)

[2022-11-22 10:24:37,282] [19036] [MainThread] [ERROR] (uvicorn.error:56) - Application startup failed. Exiting.

**To Reproduce**  
Steps to reproduce the behavior:

1. ‘in\_channel’ value edited 4 into 1 and added 'ensure\_channel\_first": ture in train.json as following.

“_target_”: “SegResNet”,  
“blocks\_down”: [  
1,  
2,  
2,  
4  
],  
“blocks\_up”: [  
1,  
1,  
1  
],  
“init\_filters”: 16,  
“in\_channels”: 1,  
“out\_channels”: 3,  
“dropout\_prob”: 0.2  
},  
“network”: “$@network\_def.to([@device](https://github.com/device))”,  
“preprocessing”: {  
“_target_”: “Compose”,  
“transforms”: [  
{  
“_target_”: “LoadImaged”,  
“keys”: “image”,  
“ensure\_channel\_first”: true  
},

1. ‘in\_channel’ value edited 4 into 1 and added 'ensure\_channel\_first": ture in train.json as following.

> edited train.json code\>

“_target_”: “SegResNet”,  
“blocks\_down”: [  
1,  
2,  
2,  
4  
],  
“blocks\_up”: [  
1,  
1,  
1  
],  
“init\_filters”: 16,  
“in\_channels”: 1,  
“out\_channels”: 3,  
“dropout\_prob”: 0.2  
},  
.  
.  
.  
“train”: {  
“preprocessing\_transforms”: [  
{  
“_target_”: “LoadImaged”,  
“keys”: [  
“image”,  
“label”,  
“ensure\_channel\_first”: true  
]  
},

1. ‘(“inputs”) num\_channel’ value edits 4 into 1 train.json as following.

“network\_data\_format”: {  
“inputs”: {  
“image”: {  
“type”: “image”,  
“format”: “magnitude”,  
“modality”: “MR”,  
“num\_channels”: 1,  
“spatial\_shape”: [  
“8_n”,  
“8_n”,  
“8\*n”  
],

**Expected behavior**  
I can expect result when I press ‘run’ button in Auto Segmentation option, after I edited and added inference.json, train.josn and metadata.json.  
[![image](https://user-images.githubusercontent.com/67679322/203200004-2f7e1187-4ec7-46a8-bb90-f7862d9a78ef.png)](https://user-images.githubusercontent.com/67679322/203200004-2f7e1187-4ec7-46a8-bb90-f7862d9a78ef.png)

[![image](https://user-images.githubusercontent.com/67679322/203198584-98b80bb9-f404-4c0a-9731-e7a80b9d47ff.png)](https://user-images.githubusercontent.com/67679322/203198584-98b80bb9-f404-4c0a-9731-e7a80b9d47ff.png)

**Screenshots**  
But I can’t extract brain tumor as following figure.

[![image](https://user-images.githubusercontent.com/67679322/203199021-29678f2d-fb3f-4f2d-a328-7bd52f93127d.png)](https://user-images.githubusercontent.com/67679322/203199021-29678f2d-fb3f-4f2d-a328-7bd52f93127d.png)

# **Environment**

# Printing MONAI config…

MONAI version: 1.0.1  
Numpy version: 1.23.4  
Pytorch version: 1.12.1+cu113  
MONAI flags: HAS\_EXT = False, USE\_COMPILED = False, USE\_META\_DICT = False  
MONAI rev id: 8271a193229fe4437026185e218d5b06f7c8ce69  
MONAI **file** : C:\Users\TRL 3D\AppData\Local\Programs\Python\Python39\lib\site-packages\monai\__init_\_.py

Optional dependencies:  
Pytorch Ignite version: 0.4.10  
Nibabel version: 4.0.2  
scikit-image version: 0.19.3  
Pillow version: 9.3.0  
Tensorboard version: 2.10.1  
gdown version: 4.5.3  
TorchVision version: 0.13.1+cu113  
tqdm version: 4.64.1  
lmdb version: 1.3.0  
psutil version: 5.9.4  
pandas version: 1.5.1  
einops version: 0.6.0  
transformers version: 4.24.0  
mlflow version: 2.0.1  
pynrrd version: 0.4.3

For details about installing the optional dependencies, please visit:  
[https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies](https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies)

# ================================

Printing system config…

System: Windows  
Win32 version: (‘10’, ‘10.0.22000’, ‘SP0’, ‘Multiprocessor Free’)  
Win32 edition: Core  
Platform: Windows-10-10.0.22000-SP0  
Processor: AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD  
Machine: AMD64  
Python version: 3.9.13  
Process name: python.exe  
Command: [‘C:\Users\TRL 3D\AppData\Local\Programs\Python\Python39\python.exe’, ‘-c’, ‘import monai; monai.config.print\_debug\_info()’]  
Open files: [popenfile(path=‘C:\Program Files\WindowsApps\Microsoft.LanguageExperiencePackko-KR\_22000.29.134.0\_neutral\_\_8wekyb3d8bbwe\Windows\System32\ko-KR\39386f74d1967f5c37a5b4171f81c8f3\kernel32.dll.mui’, fd=-1), popenfile(path=‘C:\Program Files\WindowsApps\Microsoft.LanguageExperiencePackko-KR\_22000.29.134.0\_neutral\_\_8wekyb3d8bbwe\Windows\System32\ko-KR\fe441ef3ed396a241e46f9f354057863\tzres.dll.mui’, fd=-1), popenfile(path=‘C:\Program Files\WindowsApps\Microsoft.LanguageExperiencePackko-KR\_22000.29.134.0\_neutral\_\_8wekyb3d8bbwe\Windows\System32\ko-KR\a7c1941e6709c10ab525083b61805316\KernelBase.dll.mui’, fd=-1)]  
Num physical CPUs: 8  
Num logical CPUs: 16  
Num usable CPUs: 16  
CPU usage (%): [10.3, 9.4, 6.9, 3.8, 4.4, 0.6, 1.9, 2.2, 6.6, 15.2, 7.8, 3.2, 2.2, 0.9, 6.0, 41.1]  
CPU freq. (MHz): 3301  
Load avg. in last 1, 5, 15 mins (%): [0.0, 0.0, 0.0]  
Disk usage (%): 60.3  
Avg. sensor temp. (Celsius): UNKNOWN for given OS  
Total physical memory (GB): 15.4  
Available memory (GB): 7.1  
Used memory (GB): 8.3

# ================================

Printing GPU config…

Num GPUs: 1  
Has CUDA: True  
CUDA version: 11.3  
cuDNN enabled: True  
cuDNN version: 8302  
Current device: 0  
Library compiled for CUDA architectures: [‘sm\_37’, ‘sm\_50’, ‘sm\_60’, ‘sm\_61’, ‘sm\_70’, ‘sm\_75’, ‘sm\_80’, ‘sm\_86’, ‘compute\_37’]  
GPU 0 Name: NVIDIA GeForce RTX 3070 Laptop GPU  
GPU 0 Is integrated: False  
GPU 0 Is multi GPU board: False  
GPU 0 Multi processor count: 40  
GPU 0 Total memory (GB): 8.0  
GPU 0 CUDA capability (maj.min): 8.6

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [November 22, 2022, 11:33am UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368/2 "2022-11-22T11:33:52Z")

</div>

Sorry, please understand that I do not respond to this via discourse direct mail, @platanus

You need to bring this into a readable and structured form, preferably with a native English speaker, to expect answers from the community. And it is not good to spam this forum with questions, even if they do not get answered.

---

<div class="post-metadata">

**Author:** ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)\
**Post date:** [November 22, 2022, 10:16pm UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368/3 "2022-11-22T22:16:35Z")

</div>

Dear @rbumm

Thank you for answering.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 23, 2022, 12:18am UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368/4 "2022-11-23T00:18:55Z")

</div>

This seems to be a MONAILabel core question that MONAI community members may be able to help with - see how to contact them here: [MONAI - Community](https://monai.io/community.html)

---

<div class="post-metadata">

**Author:** ![diazandr3s](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diazandr3s/32/9973_2.png) [@diazandr3s](https://discourse.slicer.org/u/diazandr3s)\
**Post date:** [November 29, 2022, 1:31am UTC](https://discourse.slicer.org/t/auto-segmentation-error-error-in-brats-mri-segmentation-v0-3-8/26368/5 "2022-11-29T01:31:32Z")

</div>

Many thanks, @rbumm @lassoan  
This question is being addressed here: [Auto Segmentation error in 'brats\_segmentation\_v0.3.3' model · Issue #239 · Project-MONAI/model-zoo · GitHub](https://github.com/Project-MONAI/model-zoo/issues/239#issuecomment-1327094860)

and here: [RuntimeError when "brats\_mri\_segmentation\_v0.2.1" from monaibundle is used. · Issue #1051 · Project-MONAI/MONAILabel · GitHub](https://github.com/Project-MONAI/MONAILabel/issues/1051)
