-
Do i need to install groundingdino? |
Beta Was this translation helpful? Give feedback.
Answered by
giswqs
Nov 1, 2024
Replies: 3 comments 1 reply
-
How did you run into this error? |
Beta Was this translation helpful? Give feedback.
0 replies
-
We got the same error when loading Full error: ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[12], line 1
----> 1 sam = LangSAM()
File /opt/conda/lib/python3.11/site-packages/samgeo/text_sam.py:127, in LangSAM.__init__(self, model_type, checkpoint)
116 """Initialize the LangSAM instance.
117
118 Args:
(...)
123 checkpoint_url (str, optional): The URL to the checkpoint file. Defaults to None
124 """
126 self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
--> 127 self.build_groundingdino()
128 self.build_sam(model_type, checkpoint)
130 self.source = None
File /opt/conda/lib/python3.11/site-packages/samgeo/text_sam.py:175, in LangSAM.build_groundingdino(self)
173 ckpt_filename = "groundingdino_swinb_cogcoor.pth"
174 ckpt_config_filename = "GroundingDINO_SwinB.cfg.py"
--> 175 self.groundingdino = load_model_hf(
176 ckpt_repo_id, ckpt_filename, ckpt_config_filename, self.device
177 )
File /opt/conda/lib/python3.11/site-packages/samgeo/text_sam.py:76, in load_model_hf(repo_id, filename, ckpt_config_filename, device)
58 """
59 Loads a model from HuggingFace Model Hub.
60
(...)
68 torch.nn.Module: The loaded model.
69 """
71 cache_config_file = hf_hub_download(
72 repo_id=repo_id,
73 filename=ckpt_config_filename,
74 force_filename=ckpt_config_filename,
75 )
---> 76 args = SLConfig.fromfile(cache_config_file)
77 model = build_model(args)
78 model.to(device)
NameError: name 'SLConfig' is not defined |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try restarting the kernel after installing |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
giswqs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try restarting the kernel after installing
groundingdino-py
.