wasserth / TotalSegmentator

Tool for robust segmentation of >100 important anatomical structures in CT and MR images
Apache License 2.0
1.42k stars 239 forks source link

'NoneType' object has no attribute 'build_network_architecture' #234

Closed rgutsche-siemens closed 1 month ago

rgutsche-siemens commented 10 months ago

I get the following errror: 'NoneType' object has no attribute 'build_network_architecture'

Something happens during the prediction. Any idea?

This is my command line:

2023-11-21 16:41:47,332 - PleuraVizUtil.logger_util - INFO - Start lung segmentation: Total Segmentator

If you use this tool please cite: https://pubs.rsna.org/doi/10.1148/ryai.230024

Using 'fast' option: resampling to lower resolution (3mm) Generating rough body segmentation... Converting dicom to nifti... found image with shape (512, 512, 610) Resampling... Resampled in 6.01s Predicting... 2023-11-21 16:42:27,253 - PleuraVizUtil.logger_util - ERROR - Exception during execution of totalsegmentator function. Exception: 'NoneType' object has no attribute 'build_network_architecture'

rgutsche-siemens commented 10 months ago
try:
    logger.info('Start lung segmentation: Total Segmentator')
    roi_subset = ['lung_upper_lobe_left', 'lung_upper_lobe_right', 'lung_lower_lobe_left', 'lung_lower_lobe_right',
                  'lung_middle_lobe_right']
    result = totalsegmentator(args.inputdir, tempOutData, output_type='nifti', roi_subset=roi_subset, fast=True, device='cpu')
except Exception as e:
    logger.error(f'Exception during execution of totalsegmentator function. Exception: {e}')
logger.info('Finished lung segmentation!')
wasserth commented 10 months ago

I think the method build_network_architecture comes form nnU-Net. Have you installed nnUNet? Otherwise I am a bit clueless about this.