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

Wrong with Slicer-MedSAM2 segmentations #49

Open
zhongthoracic opened this issue Dec 7, 2024 · 1 comment
Open

Wrong with Slicer-MedSAM2 segmentations #49

zhongthoracic opened this issue Dec 7, 2024 · 1 comment

Comments

@zhongthoracic
Copy link

Dear developer!

I have sucessfully completely Segmentation Backend Setup and Plugin Setup of MedSAM2. However, MedSAM2 could not work. After I completed the preprocessing and ROI section, I click segment Middle Slicer, then the following error occurred:

Traceback (most recent call last):
File "D:/slicer_extention/MedSAM2/MedSAMSlicer/slicer/MedSAM2/MedSAM2/MedSAM2.py", line 589, in getMiddleMask
segmentation_mask = np.load(result_path, allow_pickle=True)['segs']
File "D:\Slicer 5.4.0\lib\Python\Lib\site-packages\numpy\lib\npyio.py", line 436, in load
raise EOFError("No data left in file")
EOFError: No data left in file

In addtion, when I primarily completed Segmentation Backend Setup, as you stated in tutorial procedures, I run the following script:python infer_SAM21_slicer.py --cfg sam2.1_hiera_t.yaml --img_path img_data.npz --gts_path X --propagate N --checkpoint checkpoints/2.1/sam2.1_hiera_tiny --pred_save_dir data/video/segs_tiny, the following error occurred:
D:\slicer_extention\MedSAM2\MedSAMSlicer\sam2\modeling\sam\transformer.py:23: UserWarning: Flash Attention is disabled as it requires a GPU with Ampere (8.0) CUDA capability.
OLD_GPU, USE_FLASH_ATTN, MATH_KERNEL_ON = get_sdpa_settings()
Traceback (most recent call last):
File "D:\slicer_extention\MedSAM2\MedSAMSlicer\infer_SAM21_slicer.py", line 219, in
infer_3d(img_path, gts_path, propagate)
^^^^^^^^
NameError: name 'img_path' is not defined

I am not sure whether there were certain connections in theses two errors, my GPU is 1080TI with CUDA 14.2. Could you please help me settle this problem to run SlicerMedSAM2 properly? I have try it in many version of 3D slicer (5.2, 5.3, 5.4, 5.6 and 5.7) and python version (3.10, 3.11 and 3.12), all above attempts did not work, I still cannot use MedSAM2 in 3D slicer.

I sincerely appreciate your dedication and efforts in developing this project, which will undoubtedly benefit scientific research and medical advancement. I am also honored to be using the project you developed. However, as a doctoral student in clinical medicine rather than computer science, I seem to be unable to resolve the issues I have encountered. I apologize for the inconvenience, and I am truly grateful for your time and assistance in helping me resolve these problems. Your support is deeply appreciated!

@rasakereh
Copy link
Collaborator

i updated the sanity check, would you try again?

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