# DentalSegmentator fails with "RuntimeError: Invalid nnUNet configuration. Model folder is missing the following folds"

**URL:** <https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697>\
**Category:** Support\
**Tags:** segmentation, dental\
**Created:** [April 21, 2024, 5:55am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697 "2024-04-21T05:55:51Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARtur\_Zhumabekov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/artur_zhumabekov/32/67145_2.png) [@ARtur\_Zhumabekov](https://discourse.slicer.org/u/ARtur_Zhumabekov)\
**Post date:** [April 21, 2024, 5:55am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/1 "2024-04-21T05:55:51Z")

</div>

Hello  
I get this error  
Failed to load the segmentation.

Check the inference folder content C:\Users\artur\AppData\Local\Temp\Slicer-vFmJLy\output

How i can fix it?

---

<div class="post-metadata">

**Author:** ![Drhamidhmd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drhamidhmd/32/17725_2.png) [@Drhamidhmd](https://discourse.slicer.org/u/Drhamidhmd)\
**Post date:** [April 21, 2024, 9:10am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/2 "2024-04-21T09:10:36Z")

</div>

hello  
first i would like to congratulate for this extension.  
super cool stuff  
i would like to inform you that i have installed the new version of slicer plus the extension… and tried but its not working even after upgrading pytorch can you help me

---

<div class="post-metadata">

**Author:** ![Thibault\_Pelletier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thibault_pelletier/32/4767_2.png) [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Post date:** [April 22, 2024, 6:19am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/3 "2024-04-22T06:19:58Z")

</div>

Hi @ARtur_Zhumabekov and @Drhamidhmd,

Thank you for trying out our module.

Could you provide us with the following information so that we have a clearer view on what went wrong :

- Which OS did you try the module on
- Which preview version date did you try it on. Slicer previews are built nightly and we made several fixes to the extension since it was added to the extension manager and you may want to test on the latest preview release to check if the problem is still there.
- What is your machine configuration (RAM / CPU / GPU config)
- Could you give us the information available in the module log. The logs are accessible by clicking on the (i) button next to the apply button
- Could you give us the information available in the Python console

Thanks in advance.

Best,  
Thibault

---

<div class="post-metadata">

**Author:** ![Drhamidhmd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drhamidhmd/32/17725_2.png) [@Drhamidhmd](https://discourse.slicer.org/u/Drhamidhmd)\
**Post date:** [April 23, 2024, 8:56am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/4 "2024-04-23T08:56:48Z")

</div>

Thanks for response.  
My problem got resolved… as pytorch was not working… I reinstalled it’s working properly.  
But it’s working with CbCt but not with medical ct scan

---

<div class="post-metadata">

**Author:** ![Thibault\_Pelletier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thibault_pelletier/32/4767_2.png) [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Post date:** [April 23, 2024, 2:34pm UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/5 "2024-04-23T14:34:00Z")

</div>

@Drhamidhmd thanks for the update. Glad to know that it now works for you with your CBCT.

When you say the module doesn’t work with medical CT Scan, what do you mean? Does it not output the segmentation you are expecting? Does it not run to completion?

---

<div class="post-metadata">

**Author:** ![Drhamidhmd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drhamidhmd/32/17725_2.png) [@Drhamidhmd](https://discourse.slicer.org/u/Drhamidhmd)\
**Post date:** [May 5, 2024, 8:14am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/7 "2024-05-05T08:14:08Z")

</div>

Actually I uploaded the Medical scan on slicer and tried running the Dental segmentator…it took longer than normal time and got hanged… happened many time

---

<div class="post-metadata">

**Author:** ![the\_ice](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/the_ice/32/76585_2.png) [@the\_ice](https://discourse.slicer.org/u/the_ice)\
**Post date:** [May 20, 2024, 2:33am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/8 "2024-05-20T02:33:32Z")

</div>

I came across a mistake :

```auto
RuntimeError: Invalid nnUNet configuration. Model folder is missing the following folds : [0].
Your model weight folder path should look like the following :
Dataset<dataset_id>/<trainer_name> __<plan_name>__ <conf_name>

It should also contain a dataset.json file and fold_<i_fold> folders with model weights.

Provided model dir :
D:\ProgramData\slicer.org\Slicer 5.7.0-2024-05-15\slicer.org\Extensions-32859\DentalSegmentator\lib\Slicer-5.7\qt-scripted-modules\Resources\ML

```

It seems the path “DentalSegmentator\Resources\ML” created in SlicerDentalSegmentator is not well recognized by the nnUNet library.  
How can i fix it?

---

<div class="post-metadata">

**Author:** ![the\_ice](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/the_ice/32/76585_2.png) [@the\_ice](https://discourse.slicer.org/u/the_ice)\
**Post date:** [May 20, 2024, 6:38am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/9 "2024-05-20T06:38:38Z")

</div>

First i would like to congratulate for this extension.  
I came across a mistake :

```auto
RuntimeError: Invalid nnUNet configuration. Model folder is missing the following folds : [0].
Your model weight folder path should look like the following :
Dataset<dataset_id>/<trainer_name> __<plan_name>__ <conf_name>

It should also contain a dataset.json file and fold_<i_fold> folders with model weights.

Provided model dir :
D:\ProgramData\slicer.org\Slicer 5.7.0-2024-05-15\slicer.org\Extensions-32859\DentalSegmentator\lib\Slicer-5.7\qt-scripted-modules\Resources\ML

```

I read the related .py file.  
It seems the path “DentalSegmentator\Resources\ML” created in SlicerDentalSegmentator is not well recognized by the nnUNet library.  
In addition, the 3D Slicer is 5.7.0-2024-05-15 r32859 / 332732c, the nnUNet is Version:edb9b03 (2024-05-16).

---

<div class="post-metadata">

**Author:** ![Thibault\_Pelletier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thibault_pelletier/32/4767_2.png) [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Post date:** [May 21, 2024, 6:27am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/10 "2024-05-21T06:27:20Z")

</div>

Hi @the_ice ,

Thank you for your feedback and your interest in our extension.  
It seems the model may not have been correctly downloaded / extracted in your ML folder.

To make up for that, you can follow the troubleshooting here : [GitHub - gaudot/SlicerDentalSegmentator: 3D Slicer extension for fully-automatic segmentation of CT and CBCT dental volumes.](https://github.com/gaudot/SlicerDentalSegmentator?tab=readme-ov-file#failed-to-download--find-weights)

It consists in :

- Downloading the latest .zip file from the release and extracting it in the `DentalSegmentator\Resources\ML` folder
- Creating a `download_info.json` in the ML folder with the following content : `{ "download_url": "https://github.com/gaudot/SlicerDentalSegmentator/releases/download/v1.0.0-alpha/Dataset111_453CT_v100.zip" }`

Please let me know if that solves the issue on your end.

Best,  
Thibault

---

<div class="post-metadata">

**Author:** ![the\_ice](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/the_ice/32/76585_2.png) [@the\_ice](https://discourse.slicer.org/u/the_ice)\
**Post date:** [May 22, 2024, 12:35am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/12 "2024-05-22T00:35:17Z")

</div>

Thank you very much! The advice you gave me was very precise. 👍 👍

---

<div class="post-metadata">

**Author:** ![karim\_mamdouh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/karim_mamdouh/32/76890_2.png) [@karim\_mamdouh](https://discourse.slicer.org/u/karim_mamdouh)\
**Post date:** [June 8, 2024, 2:52pm UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/13 "2024-06-08T14:52:48Z")

</div>

hello  
i have the same issue  
Failed to load the segmentation.

Check the inference folder content C:\Users\Khateeb\AppData\Local\Temp\Slicer-iPdxkt\output

---

<div class="post-metadata">

**Author:** ![Thibault\_Pelletier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thibault_pelletier/32/4767_2.png) [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Post date:** [June 10, 2024, 6:22am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/15 "2024-06-10T06:22:05Z")

</div>

Hi @karim_mamdouh,

Thanks for your interest in our extension.  
Could you give us the log content when you experience this error?

The logs can be found by pressing the (i) button next to the apply button

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/2/126a9c1c5b97dcaeeff9384f6f3fdcbea6332d5f.png)

---

<div class="post-metadata">

**Author:** ![Marce](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/marce/32/76822_2.png) [@Marce](https://discourse.slicer.org/u/Marce)\
**Post date:** [June 10, 2024, 8:33am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/16 "2024-06-10T08:33:36Z")

</div>

> [@karim\_mamdouh](#):
>
> o se pudo cargar la segmentación.
> 
> Verifique el contenido de la carpeta de inferencia C:\Users\Khateeb\AppData\Local\Temp\Slicer-

Hello, dowload:  
[https://slicer-packages.kitware.com/api/v1/item/665d6717c8a295ea328461ef/download](https://slicer-packages.kitware.com/api/v1/item/665d6717c8a295ea328461ef/download)

This is slicer package “Slicer-5.7.0-2024-06-01-win-amd64”. this work.

---

<div class="post-metadata">

**Author:** ![viet\_duc\_Vu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/viet_duc_vu/32/66488_2.png) [@viet\_duc\_Vu](https://discourse.slicer.org/u/viet_duc_Vu)\
**Post date:** [June 10, 2024, 12:53pm UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/17 "2024-06-10T12:53:39Z")

</div>

> [@Marce](#):
>
> [https://slicer-packages.kitware.com](https://slicer-packages.kitware.com)

Thank you, this actually work !

---

<div class="post-metadata">

**Author:** ![DrG](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@DrG](https://discourse.slicer.org/u/DrG)\
**Post date:** [June 14, 2024, 10:15pm UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/18 "2024-06-14T22:15:04Z")

</div>

This worked for me as well. Reinstalling everything did nothing, but going back from June10th version to this June1st, fixed it. Thanks!

---

<div class="post-metadata">

**Author:** ![Marta\_Fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/marta_fernandez/32/10323_2.png) [@Marta\_Fernandez](https://discourse.slicer.org/u/Marta_Fernandez)\
**Post date:** [August 26, 2024, 4:12pm UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/19 "2024-08-26T16:12:00Z")

</div>

Hi, thanks for the extensión but it still not working

---

<div class="post-metadata">

**Author:** ![bina\_magomedova](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bina_magomedova/32/78221_2.png) [@bina\_magomedova](https://discourse.slicer.org/u/bina_magomedova)\
**Post date:** [October 14, 2024, 7:57am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/20 "2024-10-14T07:57:01Z")

</div>

I’ve been struggling with this problem for days and in no way. Please help me! I can’t work without this program  
 ![photo_2024-10-10_20-25-30](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c24eb1ca0f9ecb8d8c16f37fbfa270b8c1c991f2.jpeg)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 14, 2024, 11:40am UTC](https://discourse.slicer.org/t/dentalsegmentator-fails-with-runtimeerror-invalid-nnunet-configuration-model-folder-is-missing-the-following-folds/35697/21 "2024-10-14T11:40:44Z")

</div>

Review the following DentalSegmentator GitHub posts for similar reports. If you are still having issues you can try creating a new GitHub issue as a method for contacting the DentalSegmentator library maintainers. They may be more responsive there compared to the Slicer discourse forum.

> <https://github.com/gaudot/SlicerDentalSegmentator/issues/10#issuecomment-2303831994>
>
> I'm using Slicer 5.7.0 revision 32900 6-16-2024 on Windows. The error code read…s as fail to load segmentation. I can get it to work on my Mac with M1 or M2 but can get the extension to work on Windows.

> <https://github.com/gaudot/SlicerDentalSegmentator/issues/8#issuecomment-2161600947>
>
> Now I am using the 5.7.0 32881 3d slicer with EC2 ubuntu 22.04.
> When I try usin…g the cpu version of torch(2.2.1),everything works fine. However, when I use cu118 version, I get this error: failed to load the segmentation. Check ...
> This seems to be error with SlicerNNUnet(with segmentationlogic.py)
> Can you guys have a look?
> Thank you.
