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

liver_vessels subtask invokes model download everytime #371

Closed
ASHISRAVINDRAN opened this issue Oct 8, 2024 · 7 comments
Closed

liver_vessels subtask invokes model download everytime #371

ASHISRAVINDRAN opened this issue Oct 8, 2024 · 7 comments

Comments

@ASHISRAVINDRAN
Copy link

Hi @wasserth
I am from the MITK development team working to update TotalSegmentator to v2.4 for our upcoming release.
I am testing out inferencing all subtasks as part of sanity test. I see that subtask liver_vessels invokes model download from internet on every run. Its weights are not ultimately saved in the .totalsegmentator folder found in the $HOME directory after the first run.
It would be great if you can check this.

Thanks in advance

@wasserth
Copy link
Owner

wasserth commented Oct 9, 2024

Unfortunately I can not reproduce this issue. For me the weights are properly stored in the default directory ~/.totalsegmentator/nnunet/results. Which operating system are you using?

@ASHISRAVINDRAN
Copy link
Author

I can reproduce on Windows 10 and Ubuntu 22.04.
When I run Totalsegmentator -i .\example_ct.nii.gz -o .\outDir\ -ta liver_vessels I can see a tmp_download_file.zip file in the ~/.totalsegmentator/nnunet/results folder. After inferencing, its gone. Its not persisted or renamed to something in the lines of "DatasetXXX_subtask_partX..."

@mingtian126
Copy link

@wasserth Hi, I have some issue when do liver_vessels as well. When I run the following: output_img=totalsegmentator(input_img,preview=False,roi_subset=tasks), where tasks=["liver_vessels"], it gave me the following error:
File "/home/anaconda3/lib/python3.11/site-packages/totalsegmentator/python_api.py", line 358, in totalsegmentator
crop_mask[organ_seg_data == class_map_inv[roi]] = 1
~~~~~~~~~~~~~^^^^^
KeyError: 'liver_vessels'

Please help, Thank you!

@MeirBenin
Copy link

Hi @wasserth it seems like it expect for path Task008_HepaticVessel but after the extracting the zip it saved as Dataset008_HepaticVessel

@journey1234-liu
Copy link

Hi @wasserth it seems like it expect for path Task008_HepaticVessel but after the extracting the zip it saved as Dataset008_HepaticVessel

Yes, after checking the download_pretrained_weights() in libs.py, it can be confirmed that the weights path target is "Task008_HepaticVessel" instead of "Dataset008_HepaticVessel".

TotalSegmentator Version: 2.4.0

@wasserth
Copy link
Owner

In the code in download_pretrained_weights() it is using Dataset008_HepaticVessel as can be seen here:
https://github.com/wasserth/TotalSegmentator/blob/master/totalsegmentator/libs.py#L297

Can you point me where you see that Task008_HepaticVessel is being used? (it occurs in old_weights but these are being deleted, not used)

@journey1234-liu
Copy link

@wasserth I've checked again and found out that this has already been fixed in this issue through this commit. So in the latest version (2.5.0), the issue discussed above should not occur. Thank you for your attention!

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

5 participants