# LUNGMASK in Lung CT segmenter EOF error

**URL:** <https://discourse.slicer.org/t/lungmask-in-lung-ct-segmenter-eof-error/31605>\
**Category:** Support\
**Tags:** segmentation, lungctanalyzer, lung\
**Created:** [September 7, 2023, 2:52pm UTC](https://discourse.slicer.org/t/lungmask-in-lung-ct-segmenter-eof-error/31605 "2023-09-07T14:52:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BM167](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@BM167](https://discourse.slicer.org/u/BM167)\
**Post date:** [September 7, 2023, 2:52pm UTC](https://discourse.slicer.org/t/lungmask-in-lung-ct-segmenter-eof-error/31605/1 "2023-09-07T14:52:49Z")

</div>

Lung CT segmenter

I am trying to segment lung CT into lobes (Using lung mask LTRC lobes\_231). Using slicer 5.4.0.

No matter how many times I reloaded lungmask file, there still seems to be a problem with a corruption of the file.

I have Pytorch (torch and torch vision properly installed (and reinstalled) using pytorch utilities) as well as CU118.

Python Console shows the following:

Any ideas?  
Thanks very much.

Lungmask version: 0.2.16  
[Python] Failed to compute results: unexpected EOF, expected 3373102 more bytes. The file might be corrupted.  
Traceback (most recent call last):  
File “C:/ProgramData/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/LungCTAnalyzer/lib/Slicer-5.4/qt-scripted-modules/LungCTSegmenter.py”, line 1002, in runProcessing  
self.logic.applySegmentation()  
File “C:/ProgramData/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/LungCTAnalyzer/lib/Slicer-5.4/qt-scripted-modules/LungCTSegmenter.py”, line 2374, in applySegmentation  
inferer = LMInferer(modelname=‘LTRCLobes’, fillmodel=‘R231’)  
File “C:\ProgramData\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\lungmask\mask.py”, line 119, in **init**  
self.model = get\_model(self.modelname, modelpath)  
File “C:\ProgramData\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\lungmask\mask.py”, line 50, in get\_model  
state\_dict = torch.hub.load\_state\_dict\_from\_url(  
File “C:\ProgramData\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\torch\hub.py”, line 750, in load\_state\_dict\_from\_url  
return torch.load(cached\_file, map\_location=map\_location)  
File “C:\ProgramData\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\torch\serialization.py”, line 815, in load  
return \_legacy\_load(opened\_file, map\_location, pickle\_module, \*\*pickle\_load\_args)  
File “C:\ProgramData\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\torch\serialization.py”, line 1051, in \_legacy\_load  
typed\_storage.\_untyped\_storage.\_set\_from\_file(  
RuntimeError: unexpected EOF, expected 3373102 more bytes. The file might be corrupted.  
[VTK] Warning: In vtkMRMLSegmentationDisplayNode.cxx, line 295  
[VTK] vtkMRMLSegmentationDisplayNode (0000015A41082A30): vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=, return default

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [September 8, 2023, 6:36am UTC](https://discourse.slicer.org/t/lungmask-in-lung-ct-segmenter-eof-error/31605/2 "2023-09-08T06:36:10Z")

</div>

Lungmask works well on our systems. That is what I get when I use the CT Chest demo dataset and 5.4.0 with lungmaskLCTRlobes:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/4/54b01facf9408368adc3753d340b397d2c3ff8ac.jpeg)

(Windows gaming laptop with an NVIDIA Geforce GTX 1060)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [September 8, 2023, 6:42am UTC](https://discourse.slicer.org/t/lungmask-in-lung-ct-segmenter-eof-error/31605/3 "2023-09-08T06:42:12Z")

</div>

My recommendation would be to delete everything and start from scratch again - Install 3D Slicer, Pytorch via the Pytorch extension, restart Slicer, and then install Lung CT Analyzer. Some files may be corrupted.
