bingogome / samm

A 3D Slicer integration to Meta's SAM.
https://arxiv.org/abs/2304.05622
MIT License
241 stars 34 forks source link

FileNotFoundError when running sam_server.py #31

Closed rjkowalski closed 1 year ago

rjkowalski commented 1 year ago

Discussed in https://github.com/bingogome/samm/discussions/30

Originally posted by **rjkowalski** May 5, 2023 I have the v1.0.3 3D Slicer extension installed in 3D Slicer v5.2.2 running on macOS. When I load up a 3D volume or 2D slice and add a few prompts, the running SAM server throws the following error: File "/Users/my_user/GitHub/samm/samm-python-terminal/sam_server.py", line 273, in main srv.infer_image( \ File "/Users/my_user/GitHub/samm/samm-python-terminal/sam_server.py", line 184, in infer_image self.load_feature(os.path.join(self.workspace, "segmented_images", "segmented_" + image_name + ".pkl")) File "/Users/my_user/GitHub/samm/samm-python-terminal/sam_server.py", line 166, in load_feature with open(self.feature_path, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/my_userGitHub/samm/samm-python-terminal/samm-workspace/segmented_images/segmented_slc24.pkl' This error repeats numerous times when i add the first prompt point. I had a look in the samm folder: samm -- samm-python-terminal -- samm-workspace and only have the following files: config.yaml imgsize imgsize_input_size imgsize_original_size mask.memmap sam_vit_h_4b8939.pth slices/ The slices directory is empty. Any suggestions or ideas on what is happening here? Thanks! Jeff
bingogome commented 1 year ago

Have you clicked "compute embedding" before adding prompts? If the slices folder is empty, it might have been that.

rjkowalski commented 1 year ago

That did it! Thanks, @bingogome .