Monai Label in 3d slicer -auto segmentation is not working for loaded data

Hi Team,
I am facing trouble to get the model to run on auto segmentation,I tried with the sample datatsets with segmentation-spleen model and even on deepedit model,in both case autosegmentation is not showing any models.
As of now my aim is to automate the segmentation of liver,hepatic vein and portal vein.

The standard MONAILabel radiology app works in 3D Slicer 3.2.2, provided you have a GPU on the server computer and enough VRAM on the NVIDIA GPU.

I used:

monailabel start_server --app MONAILabel/sample-apps/radiology --studies c:/Data/Task06_Lung/imagesTr --conf models segmentation

Make sure you install MONAILabel correctly, maybe restart from scratch and follow our recipe
Work on small or resampled datasets.

Using the pre-trained “segmentation” model on an AWS server with an A10G GPU (24GB):

You would have to invest more training for better results.

MONAILabel version: 0.7.0rc7+2.g943d545
Numpy version: 1.23.5
Pytorch version: 1.13.1+cu117
MONAILabel rev id: 943d545efdc6e3d6a50f959b1d7dd1b19d80e372


I had re installed Monai again with different with different version but again auto segmentation was disable

What are your system specifications, Linda?

AMD Ryzen 5 PRO 5675U with Radeon Graphics 2.30 GHz
64-bit operating system, x64-based processor

I have never got MONAILabel running on a non-NVIDIA GPU or an NVIDIA GPU with less than 6 GB of VRAM.
Your non-display of the auto-segmentation model may be connected to that fact. You should be able to get TotalSegmentator (see your other thread) up and running if you install Pytorch (from the Pytorch extension) in CPU mode.
But the best thing would be to upgrade your hardware or use a cloud server.

Hi, using pycharm and slicer 5.2.2, i7 and rts3070 laptop (ram of 8gb?)
I do need that the source volume cannot be chosen/shown, device is CPU and the auto seg cannot be run?

Please advise. Thanks.

Resolved. Graphics Settings and Slicer.

2 Likes

On your point on cloud computing, have you been successful in deploring the radiology app/ slicer/ monai label on colab?

Just for other visitors: Could you please specify exactly how you resolved your problem?

We were able to implement MonaiLabel on an AWS EC2 Windows server instance but not on a Colab.
Maybe @diazandr3s is aware of a Colab implementation?

Hi Rudolf,
I am using pycharm and slicer 5.2.2.

I have using pycharm and python 3.9 and have run
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

In slicer 5.2.2 python intrepretor,
import torch; print(torch.cuda.is_available())
output is TRUE.

I have an i7, 3070 laptop gpu, and was able to run autosegmenation in monailabel.
however, i realise that the infer and within the infer is always cpu and i cannot change this.


task manager sees little to no gpu activity and i have enabled high performance for slicer in the nvida control.

The real issue is when I want to run my own data -
AppData\Local\NA-MIC\Slicer 5.2.2\NA-MIC\Extensions-31382\MONAILabel\lib\Slicer-5.2\qt-scripted-modules\MONAILabelLib\client.py", line 344, in infer
raise MONAILabelClientException(
MONAILabelLib.client.MONAILabelClientException: (1, ‘Status: 500; Response: Internal Server Error’)

log reads - [2023-09-02 23:39:53,031] [24088] [MainThread] [INFO] (monailabel.tasks.infer.basic_infer:480) - Inferer:: cpu => SlidingWindowInferer => {‘roi_size’: (96, 96, 96), ‘sw_batch_size’: 2, ‘overlap’: 0.4, ‘mode’: gaussian, ‘sigma_scale’: 0.125, ‘padding_mode’: ‘replicate’, ‘cval’: 0.0, ‘sw_device’: None, ‘device’: None, ‘progress’: False, ‘cpu_thresh’: None, ‘buffer_steps’: None, ‘buffer_dim’: -1, ‘roi_weight_map’: None}

any advice?

  • Uninstall everything.

  • Freshly install:5.4.0

  • Pytorch Utilities and Pytorch

  • Restart Slicer.

  • Install the Monailabel extension.

  • Install the Monailabel server separately on your computer. It must not residue in the Python interactor and within 3D Slicer. Ensure that CUDA support is available there.

  • Download the Monailabel apps and datasets that you need depending on the nature of your project.

  • Start the ML server

  • Start Slicer
    Start the ML extension

  • connect the server to the MonaiLabel extension.by just presssing enter in the ML server line.

Thanks for the ping, @rbumm

@Ylim, Colab is a Jupyter Notebook service. It is not intended for server hosting. Unless you mean using Colab to run shell commands and start the server in the background.

If this is the case, you must ensure permanent access to the same instance or computing resources. Something that’s not common in Colab.

Hope this helps,

@diazandr3s and @rbumm , the two of you have been very helpful/

@rbumm, i did find out the specific problem in my case, both the right version of pytorch must be installed in at both ends.

1 Like

Can you explain how you resolved the “auto segmentation not working” problem? i also got this problem and still not resolved