Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

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

Open zjb2020 opened this issue 2 years ago • 4 comments

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

zjb2020 avatar Apr 12 '23 04:04 zjb2020

What's your pytorch version~

rentainhe avatar Apr 12 '23 07:04 rentainhe

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

raymond1123 avatar Apr 14 '23 02:04 raymond1123

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.

SlongLiu avatar Apr 14 '23 03:04 SlongLiu

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

zjb2020 avatar Apr 14 '23 03:04 zjb2020