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.85k stars 1.37k forks source link

when i try to run Grounded-SAM + Stable-Diffusion Inpainting,and i finally got this error,pls help? #89

Open zjb2020 opened 1 year ago

zjb2020 commented 1 year ago

File "/root/autodl-tmp/zjb/hand/Segment-Anything/Grounded-Segment-Anything-main/grounded_sam_inpainting_demo.py", line 159, in predictor = SamPredictor(build_sam(checkpoint=sam_checkpoint)) File "/root/autodl-tmp/zjb/hand/Segment-Anything/Grounded-Segment-Anything-main/segment_anything/segment_anything/build_sam.py", line 15, in build_sam_vit_h return _build_sam( File "/root/autodl-tmp/zjb/hand/Segment-Anything/Grounded-Segment-Anything-main/segment_anything/segment_anything/build_sam.py", line 105, in _build_sam state_dict = torch.load(f) File "/root/miniconda3/lib/python3.10/site-packages/torch/serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/root/miniconda3/lib/python3.10/site-packages/torch/serialization.py", line 283, in init super().init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

rentainhe commented 1 year ago

What's your pytorch version~

raymond1123 commented 1 year ago

@rentainhe I also met this problem, my torch version is: 1.11.0+cu113

SlongLiu commented 1 year ago

See the suggestions here: https://stackoverflow.com/questions/71617570/pytorchstreamreader-failed-reading-zip-archive-failed-finding-central-directory

It happens when the file is corrupted. Removing the caches for torch hub or other models should do the trick. In Google Colab I find them in /root/.cache/ etc.

zjb2020 commented 1 year ago

i fix this problems,is because one of the model didnt download succesful,may be this why?