finetune-anything icon indicating copy to clipboard operation
finetune-anything copied to clipboard

segmentation!

Open HaoranRS opened this issue 1 year ago • 5 comments

Issuer:'MaskDecoder' object has no attribute 'iou_head_depth'. What is the cause of this problem?

HaoranRS avatar Jun 05 '23 09:06 HaoranRS

Issuer:'MaskDecoder' object has no attribute 'iou_head_depth'. What is the cause of this problem?

Have you installed the official SAM before? Finetune-Anything (FA) has modified the code of the original SAM model. If the SAM you imported is official, please make sure that the imported SAM is the modified SAM model in FA. The FA modified model code is at this line

ziqi-jin avatar Jun 06 '23 02:06 ziqi-jin

@ziqi-jin Thank you for your owesome work! This problem is solved by replace line4 in extend_sam/extend_sam.py from sagment_anything import sam_model_registry -> from .segment_anything_ori import sam_model_registry And if I want to train my dataset as resolution(1280x1280), the dim mismatch error occured: RuntimeError: The size of tensor a (80) must match the size of tensor b (64) at non-singleton dimension 2 Could you help me to solve this problem?

GesilaA avatar Jun 06 '23 06:06 GesilaA

@ziqi-jin Thank you for your owesome work! This problem is solved by replace line4 in extend_sam/extend_sam.py from sagment_anything import sam_model_registry -> from .segment_anything_ori import sam_model_registry And if I want to train my dataset as resolution(1280x1280), the dim mismatch error occured: RuntimeError: The size of tensor a (80) must match the size of tensor b (64) at non-singleton dimension 2 Could you help me to solve this problem?

Now the parameters of Finetune Anything are not connected with the model input of SAM, you may need to manually modify the initialization input of the original SAM model. Because the input of the model involves some testing problems, it has not been implemented yet, and I will fix this problem later. At the same time, if you solve this problem, you are also welcome to submit a PR

ziqi-jin avatar Jun 07 '23 05:06 ziqi-jin

@ziqi-jin Thank you for your owesome work! This problem is solved by replace line4 in extend_sam/extend_sam.py from sagment_anything import sam_model_registry -> from .segment_anything_ori import sam_model_registry And if I want to train my dataset as resolution(1280x1280), the dim mismatch error occured: RuntimeError: The size of tensor a (80) must match the size of tensor b (64) at non-singleton dimension 2 Could you help me to solve this problem?

Thanks, I will test and fix the import bugs

I have checked the code, and the latest version has solved this problem

ziqi-jin avatar Jun 07 '23 05:06 ziqi-jin

I try to train my model 128x128 and I am getting similar error

RuntimeError: The size of tensor a (8) must match the size of tensor b (64) at non-singleton dimension 2

How can I resolve problem quickly?

aylinSyntonym avatar Nov 13 '23 13:11 aylinSyntonym