Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Encountered inf in predicted array. Aborting... #346

Open
hari3100 opened this issue Aug 2, 2024 · 2 comments
Open

RuntimeError: Encountered inf in predicted array. Aborting... #346

hari3100 opened this issue Aug 2, 2024 · 2 comments

Comments

@hari3100
Copy link

hari3100 commented Aug 2, 2024

This is a awesome ripo, Thank you @wasserth for this.
Im using on my laptop with a intel core i7 with no gpu in it . python==3.10, torch==2.4.0 , i tried using the totalsegmentator v2.3.0 still the issue is there , i was first on the lastest version as of now that is 2.40 where i first got this error. is it normal for a system of my configeration to take 11 to 13 mins to produce result from a nifti file , or was I taking so long because I was ought to get this error?

my code:
import nibabel as nib
from totalsegmentator.python_api import totalsegmentator

input_path = 'D:\Totalsegmentator\data\lung_003.nii.gz'
output_path = 'D:\Totalsegmentator\data\mask\output from ts'
zone = ['lung_upper_lobe_left', 'lung_lower_lobe_left', 'lung_upper_lobe_right', 'lung_middle_lobe_right', 'lung_lower_lobe_right']

if name == "main":
input_img = nib.load(input_path)
output_img = totalsegmentator(input_img, ml=True, roi_subset_robust=zone)
nib.save(output_img, output_path)

Error:


RuntimeError Traceback (most recent call last)
Cell In[17], line 8
1 if name == "main":
2 # # option 1: provide input and output as file paths
3 # totalsegmentator(input_path, output_path, fast=True, roi_subset_robust=["lung_upper_lobe_left", "lung_lower_lobe_left", "lung_upper_lobe_right",
4 # "lung_middle_lobe_right", "lung_lower_lobe_right"])
5
6 # option 2: provide input and output as nifti image objects
7 input_img = nib.load(input_path)
----> 8 output_img = totalsegmentator(input_img, ml=True, roi_subset_robust=zone)
9 nib.save(output_img, output_path)

.....
606 del predicted_logits, n_predictions, prediction, gaussian, workon

RuntimeError: Encountered inf in predicted array. Aborting... If this problem persists, reduce value_scaling_factor in compute_gaussian or increase the dtype of predicted_logits to fp32

Did anyone face this error ?

Thank you for any help provided.

@wasserth
Copy link
Owner

wasserth commented Aug 6, 2024

This is a known issue and needs to be solved by nnUNet: MIC-DKFZ/nnUNet#2396

@hari3100
Copy link
Author

This is a known issue and needs to be solved by nnUNet: MIC-DKFZ/nnUNet#2396

Is it solved yet from their end ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants