add: example notebooks to train and predict#38
add: example notebooks to train and predict#38rabiaedayilmaz wants to merge 10 commits intoImprintLab:mainfrom
Conversation
rabiaedayilmaz
commented
Sep 7, 2024
- created examples folder
- added quick start colab notebook that trains&validates 2d refuge data
i tried colab notebook with a100, l4, and t4. notebook mysteriously crashed. surprisingly, on kaggle, notebook did run with minor fix /content -> /kaggle/working but got this error anyway thanks. i will try notebook way without using conda. |
|
Actually I removed the part where I added reshape func, since my PR was merged :/ Kaggle one interesting... I guess the problem related to GPU architecture differences? The note from my local notebook: changed view to reshape in vision_feats_temp var on line 104#vision_feats_temp = vision_feats[-1].permute(1, 0, 2).reshape(B, -1, 64, 64)` So for colab, can you add this cell right before training command and try again? @ibinti |
i did not add the cell you suggest and run because i have already forked the repo and so can modify my fork. i commented out the line #335 of function.py and added .reshape() like you showed: this fix made both kaggle p100 and colab t4 happy. here are training log outputs from both. kaggle p100 colab t4 thanks! |
|
this is to make the story complete with 3d train. one does build cuda extension like this. where setup.py is not in the Medical-SAM2 repo, i copied one from the upstream meta segment-anything-2 repo. this is the log output from train_3d.py on colab l4: it would be nice if setup.py is included in the Medical-SAM2, and provide an instruction for anyone having conflicting cuda extension issue on their system. thanks! |
|
Hi @ibinti, thank you so much! I was stuck at this problem, however, couldn't find any appropriate time to focus on this. This helped me! But... I have a problem with training 3d on Colab/Kaggle. I got this error, after resolving a bunch of them: Then I changed in sam2_train/modeling/backbones/hieradet.py the F._scaled_dot_product_attention since I got this error: Do you have any idea? |
|
hello @rabiaedayilmaz , |
|
Hi @ibinti , I see. |
I would love to have a notebook capable of 3D training on my own dataset. If you could provide yours to start with, that would be great. Thank you. |