Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When setting up the segment_anything_2_video environment, an error occurred, preventing the normal activation of label-studio-ml #652

Open
JalingHerny opened this issue Oct 17, 2024 · 1 comment

Comments

@JalingHerny
Copy link

I want to use segment_anything_2_video in conjunction with label-studio for video annotation, but when I run label-studio-ml start .\segment_anything_2_video in the directory C:\Users\Admin\label-studio-ml-backend\label_studio_ml\examples, the following error occurs:

**Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 92, in _call_target
return target(*args, **kwargs)
File "C:\Users\Admin\label-studio-ml-backend\label_studio_ml\sam2\sam2\sam2_video_predictor.py", line 36, in init
super().init(**kwargs)
TypeError: SAM2Base.init() missing 3 required positional arguments: 'image_encoder', 'memory_attention', and 'memory_encoder'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Admin\label-studio-ml-backend\label_studio_ml\examples\segment_anything_2_video_wsgi.py", line 33, in
from model import NewModel
File "C:\Users\Admin\label-studio-ml-backend\label_studio_ml\examples\segment_anything_2_video\model.py", line 39, in
predictor = build_sam2_video_predictor(MODEL_CONFIG, sam2_checkpoint)
File "C:\Users\Admin\label-studio-ml-backend\label_studio_ml\sam2\sam2\build_sam.py", line 129, in build_sam2_video_predictor
model = instantiate(cfg.model, recursive=True)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 226, in instantiate
return instantiate_node(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 347, in instantiate_node
return _call_target(target, partial, args, kwargs, full_key)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 97, in _call_target
raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error in call to target 'sam2.sam2_video_predictor.SAM2VideoPredictor':
TypeError("SAM2Base.init() missing 3 required positional arguments: 'image_encoder', 'memory_attention', and 'memory_encoder'")
full_key: model**

I have been trying for a while. Has anyone encountered the same issue? I need assistance. Thank you very much.

Path to execute SAM2 : C:\Users\Admin\label-studio-ml-backend\label_studio_ml\examples\segment_anything_2_video
Installation path for SAM 2.1 development kit : C:\Users\Admin\label-studio-ml-backend\label_studio_ml\sam2

( OS : Windows 11 )

Here are the versions of the software :
python => 3.10.11
torch => 2.4.1+cu118
torchvision => 0.19.1+cpu
cuda => 11.8

@makseq
Copy link
Member

makseq commented Oct 21, 2024

The recommended way to run ML backends is to use docker compose.

These errors look like incorrect dependencies in your python packages and docker-compose typically solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants