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.11k stars 1.31k forks source link

No such file or directory: 'groundingdino_swint_ogc.pth' #497

Open lylsalt opened 2 months ago

lylsalt commented 2 months ago

how to solve this problem I am sure i have this file (label) D:\Desktop\text\Grounded-Segment-Anything>python automatic_label_ram_demo.py --config GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py --ram_checkpoint ram_swi n_large_14m.pth --grounded_checkpoint groundingdino_swint_ogc.pth --sam_checkpoint sam_vit_h_4b8939.pth --input_image assets/demo9.jpg --output_dir "outputs" --box_threshold 0.25 --text_threshold 0.2 --iou_threshold 0.5 --device "cuda" final text_encoder_type: bert-base-uncased Traceback (most recent call last): File "automatic_label_ram_demo.py", line 236, in model = load_model(config_file, grounded_checkpoint, device=device) File "automatic_label_ram_demo.py", line 84, in load_model checkpoint = torch.load(model_checkpoint_path, map_location="cpu") File "C:\Users\LYL.conda\envs\label\lib\site-packages\torch\serialization.py", line 997, in load with _open_file_like(f, 'rb') as opened_file: File "C:\Users\LYL.conda\envs\label\lib\site-packages\torch\serialization.py", line 444, in _open_file_like return _open_file(name_or_buffer, mode) File "C:\Users\LYL.conda\envs\label\lib\site-packages\torch\serialization.py", line 425, in init super().init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'groundingdino_swint_ogc.pth'

jtabor commented 1 month ago

You need to download the weights. From the readme:

mkdir weights cd weights wget -q https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth cd ..