Facing a few issues while using monailabel training.
1)
[Python] Failed to run inference in MONAI Label Server.
[Python] Message: Status: 500; Response: Internal Server Error
Traceback (most recent call last):
File “C:/Users/admin/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/MONAILabel/lib/Slicer-5.6/qt-scripted-modules/MONAILabel.py”, line 1545, in onClickSegmentation
result_file, params = self.logic.infer(model, image_file, params, session_id=self.getSessionId())
File “C:/Users/admin/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/MONAILabel/lib/Slicer-5.6/qt-scripted-modules/MONAILabel.py”, line 2321, in infer
result_file, params = client.infer(model, image_in, params, label_in, file, session_id)
File “C:\Users\admin\AppData\Local\slicer.org\Slicer 5.6.2\slicer.org\Extensions-32448\MONAILabel\lib\Slicer-5.6\qt-scripted-modules\MONAILabelLib\client.py”, line 344, in infer
raise MONAILabelClientException(
MONAILabelLib.client.MONAILabelClientException: (1, ‘Status: 500; Response: Internal Server Error’)
training bar and accuracy bar shows training error and accuracy 0.
3)happens during training
RuntimeError: Error(s) in loading state_dict for SegResNet:
size mismatch for conv_final.2.conv.weight: copying a param with shape torch.Size([26, 32, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1, 1]).
size mismatch for conv_final.2.conv.bias: copying a param with shape torch.Size([26]) from checkpoint, the shape in current model is torch.Size([3]).
It looks like the issue might be related to a mismatch between the number of labels the model was trained on and those defined in the config file. Could you please share a bit more detail so we can help replicate the issue?
Error in console: File “/home/mirospiro/anaconda3/lib/python3.12/site-packages/monailabel/tasks/infer/basic_infer.py”, line 479, in _get_network
network.load_state_dict(model_state_dict, strict=self.load_strict)
File “/home/mirospiro/anaconda3/lib/python3.12/site-packages/torch/nn/modules/module.py”, line 2584, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for SegResNet:
size mismatch for conv_final.2.conv.weight: copying a param with shape torch.Size([26, 32, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1, 1]).
size mismatch for conv_final.2.conv.bias: copying a param with shape torch.Size([26]) from checkpoint, the shape in current model is torch.Size([3]).
[2025-02-14 19:56:02,928] [295788] [Thread-4] [INFO] (monailabel.utils.sessions: