-
Notifications
You must be signed in to change notification settings - Fork 19
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
inference No module named 'detectron2' #19
Comments
Were you able to figure this out? I'm on travel right now but I can help take a look after getting back to my workstation. |
@GISScience detectron2 needs to be installed following https://detectron2.readthedocs.io/tutorials/install.html |
Even after installing detectron2 , i am geeeting this error.. please help.. |
Been quite busy recently - re your questions @GISScience:
|
i am executing inference with your checkpoint --- but i am getting error
Google Colab Commands
%cd /content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/sam
!python /content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/inferencer.py --config /content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/config/toponet_vitb_256.yaml --output_dir /content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/output/
Error
/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/sam
Traceback (most recent call last):
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/inferencer.py", line 10, in
from model import SAMRoad
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/model.py", line 24, in
import vitdet
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/vitdet.py", line 11, in
from detectron2.modeling import ViT
ModuleNotFoundError: No module named 'detectron2'
Then i removed import vitdet
now i am getting this error with checkpoint shared by you.
/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/sam
Traceback (most recent call last):
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/inferencer.py", line 247, in
net = SAMRoad(config)
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/model.py", line 361, in init
new_state_dict = self.resize_sam_pos_embed(ckpt_state_dict, image_size, vit_patch_size, encoder_global_attn_indexes)
File "/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/model.py", line 383, in resize_sam_pos_embed
pos_embed = new_state_dict['image_encoder.pos_embed']
KeyError: 'image_encoder.pos_embed'
Config
SAM_VERSION: 'vit_b'
SAM_CKPT_PATH: '/content/drive/MyDrive/Colab_Notebooks/htcr_sam/sam_road/sam_ckpts/spacenet_vitb_256_e10.ckpt'
PATCH_SIZE: 256
BATCH_SIZE: 64
DATA_WORKER_NUM: 1
where i am doing mistake .
please look at my shared colab here.
https://drive.google.com/file/d/1IxdmtQ8VIAJ9kENeb5HJbTEloNzITncF/view?usp=sharing
is it true that minimum we need 30 gb RAM to use SAM_Road
The text was updated successfully, but these errors were encountered: