openmedlab / MedLSAM

MedLSAM: Localize and Segment Anything Model for 3D Medical Images
Apache License 2.0
488 stars 19 forks source link

Crashing #8

Open boveis opened 1 year ago

boveis commented 1 year ago

We want to test this model on Google Colab, but at the beginning of the execution, when it comes to reorienting the support image, we crashed! Can you help us run this model on Colab?

code block

CUDA_VISIBLE_DEVICES=0 python MedLAM_Inference.py --config_file config/test_config/test_structseg_medlam.txt

error

data support_image_ls config/data/StructSeg_HaN/support_image.txt config/data/StructSeg_HaN/support_image.txt data support_label_ls config/data/StructSeg_HaN/support_label.txt config/data/StructSeg_HaN/support_label.txt data query_image_ls config/data/StructSeg_HaN/query_image.txt config/data/StructSeg_HaN/query_image.txt data query_label_ls config/data/StructSeg_HaN/query_label.txt config/data/StructSeg_HaN/query_label.txt data gt_slice_threshold 10 10 data fg_class [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] weight medlam_load_path checkpoint/medlam.pth checkpoint/medlam.pth data support_image_ls config/data/StructSeg_HaN/support_image.txt config/data/StructSeg_HaN/support_image.txt data support_label_ls config/data/StructSeg_HaN/support_label.txt config/data/StructSeg_HaN/support_label.txt data query_image_ls config/data/StructSeg_HaN/query_image.txt config/data/StructSeg_HaN/query_image.txt data query_label_ls config/data/StructSeg_HaN/query_label.txt config/data/StructSeg_HaN/query_label.txt data gt_slice_threshold 10 10 data fg_class [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] weight medlam_load_path checkpoint/medlam.pth checkpoint/medlam.pth => loading medlam checkpoint 'checkpoint/medlam.pth' => loaded medlam checkpoint 'checkpoint/medlam.pth' Loading support class: 1 0% 0/5 [00:00<?, ?it/s] The image is not in the target orientation. Reorienting... The image is not in the target orientation. Reorienting... ^C

LWHYC commented 11 months ago

We want to test this model on Google Colab, but at the beginning of the execution, when it comes to reorienting the support image, we crashed! Can you help us run this model on Colab?

code block

CUDA_VISIBLE_DEVICES=0 python MedLAM_Inference.py --config_file config/test_config/test_structseg_medlam.txt

error

data support_image_ls config/data/StructSeg_HaN/support_image.txt config/data/StructSeg_HaN/support_image.txt data support_label_ls config/data/StructSeg_HaN/support_label.txt config/data/StructSeg_HaN/support_label.txt data query_image_ls config/data/StructSeg_HaN/query_image.txt config/data/StructSeg_HaN/query_image.txt data query_label_ls config/data/StructSeg_HaN/query_label.txt config/data/StructSeg_HaN/query_label.txt data gt_slice_threshold 10 10 data fg_class [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] weight medlam_load_path checkpoint/medlam.pth checkpoint/medlam.pth data support_image_ls config/data/StructSeg_HaN/support_image.txt config/data/StructSeg_HaN/support_image.txt data support_label_ls config/data/StructSeg_HaN/support_label.txt config/data/StructSeg_HaN/support_label.txt data query_image_ls config/data/StructSeg_HaN/query_image.txt config/data/StructSeg_HaN/query_image.txt data query_label_ls config/data/StructSeg_HaN/query_label.txt config/data/StructSeg_HaN/query_label.txt data gt_slice_threshold 10 10 data fg_class [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] weight medlam_load_path checkpoint/medlam.pth checkpoint/medlam.pth => loading medlam checkpoint 'checkpoint/medlam.pth' => loaded medlam checkpoint 'checkpoint/medlam.pth' Loading support class: 1 0% 0/5 [00:00<?, ?it/s] The image is not in the target orientation. Reorienting... The image is not in the target orientation. Reorienting... ^C

Thank you for reaching out regarding the issue you encountered while executing the MedLSAM code. Based on the details provided, it appears that there wasn’t a specific error message before the runtime crashed, which makes it somewhat challenging to pinpoint the exact cause of the issue. However, based on my experience, such crashes can often be attributed to memory overload.

Given the nature of medical image analysis tasks which typically require handling of large data volumes, it is plausible that the system might have run out of memory during the execution, especially when loading and processing the images.

I would recommend monitoring the memory usage while running the script. You can use tools like htop or free -m on a UNIX-based system to monitor memory usage in real time. I hope these suggestions prove helpful in resolving the issue you are facing. Please feel free to reach out should you encounter any further challenges or if there is any additional information I can provide to assist you better.

Looking forward to hearing from you soon.