MobileSAM icon indicating copy to clipboard operation
MobileSAM copied to clipboard

Report two bugs in using MobileSAMv2

Open GPIOX opened this issue 2 years ago • 6 comments

Thank you for releasing MobileSAMv2. It is a useful tool in my research and saves more training time and memory

I would report two bugs in using MobileSAMv2 and I deal with these questions:

1. TypeError: 'type' object is not subscriptable: Many codes such as scale_factor: list[float] or None = None, report TypeError.

To do this correctly, maybe you should try:

from typing import List, Dict, Tuple scale_factor: List[float] or None = None

2. MobileSAMv2/efficientvit/models/nn/act.py: 21 Line: "gelu": partial(nn.GELU, approximate="tanh") report ValueError: partial object functools.partial(<class 'torch.nn.modules.activation.GELU'>, approximate='tanh') has incorrect arguments

My solution is replacing "partial(nn.GELU, approximate="tanh")" as nn.GELU

This is the first time I've used the issue feature, so I apologize for any mistakes.

GPIOX avatar Dec 20 '23 08:12 GPIOX

The first problem may be the python version, >= 3.9

yl17104265 avatar Dec 21 '23 11:12 yl17104265

Hello, may I ask if I have the following error, how should I solve it?

Traceback (most recent call last): File "D:\MobileSAM\MobileSAMv2\Inference.py", line 122, in main(args) File "D:\MobileSAM\MobileSAMv2\Inference.py", line 79, in main input_boxes1 = obj_results[0].boxes.xyxy TypeError: 'NoneType' object is not subscriptable

yanzongs avatar Mar 19 '24 08:03 yanzongs

Hi, it usually means that the model didn't predict any object on that image, so the obj_results is empty.

IuliaElisa avatar Mar 19 '24 08:03 IuliaElisa

Hi, it usually means that the model didn't predict any object on that image, so the obj_results is empty.

But I used the official photo input, why did I fail to predict the object? I also reported the same error when I used another photo input

yanzongs avatar Mar 19 '24 08:03 yanzongs

python 3.9, same question

moyans avatar Mar 22 '24 03:03 moyans

Hi, it usually means that the model didn't predict any object on that image, so the obj_results is empty.

But I used the official photo input, why did I fail to predict the object? I also reported the same error when I used another photo input

did u find the resolution for this issue? it also occurs when i try to use the official photo

yyf2002 avatar Sep 27 '24 01:09 yyf2002