IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
14.12k stars 1.31k forks source link

RuntimeError: "sigmoid_cpu" not implemented for 'Half', when run command 'python grounding_dino_demo.py' #479

Open loubron23 opened 3 months ago

loubron23 commented 3 months ago

(sam) loubron@loubron-PC:~/disk/sam/Grounded-Segment-Anything$ python grounding_dino_demo.py UserWarning: Failed to load image Python extension: libc10_hip.so: cannot open shared object file: No such file or directory UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.) final text_encoder_type: bert-base-uncased Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertModel: ['cls.seq_relationship.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.bias']

live-github commented 3 months ago

Use cuda or remove # if FP16_INFERENCE # image = image.half() # model = model.half() in the grounding_dino_demo.py

JCBreath commented 2 months ago

Use cuda or remove # if FP16_INFERENCE # image = image.half() # model = model.half() in the grounding_dino_demo.py

Works perfectly, thanks!

rexainn commented 1 month ago

Use cuda or remove # if FP16_INFERENCE # image = image.half() # model = model.half() in the grounding_dino_demo.py

I'm sorry but I want to know how to use cuda for this script? I can use cuda for anything else, I think cuda will also work well for this project, but it's not. Should I need some extra settings?