gligen / GLIGEN

Open-Set Grounded Text-to-Image Generation
MIT License
1.92k stars 144 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'gligen_checkpoints/checkpoint_generation_text.pth' #13

Closed YJ-142150 closed 1 year ago

YJ-142150 commented 1 year ago

Thanks for your great work. I downloaded a model diffusion_pytorch_model.bin in HF hub. I unzipped it and placed at gligen_checkpoints directory, but this error appeared.

Traceback (most recent call last):
  File "gligen_inference.py", line 434, in <module>
    run(meta, args, starting_noise)
  File "/home/lambdasix/anaconda3/envs/GLIGEN/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "gligen_inference.py", line 219, in run
    model, autoencoder, text_encoder, diffusion, config = load_ckpt(meta["ckpt"])
  File "gligen_inference.py", line 70, in load_ckpt
    saved_ckpt = torch.load(ckpt_path)
  File "/home/lambdasix/anaconda3/envs/GLIGEN/lib/python3.8/site-packages/torch/serialization.py", line 771, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/lambdasix/anaconda3/envs/GLIGEN/lib/python3.8/site-packages/torch/serialization.py", line 270, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/lambdasix/anaconda3/envs/GLIGEN/lib/python3.8/site-packages/torch/serialization.py", line 251, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'gligen_checkpoints/checkpoint_generation_text.pth'

Is it possible to use pretrained model now?

haotian-liu commented 1 year ago

Please try renaming diffusion_pytorch_model.bin to checkpoint_generation_text.pth instead of unzipping it. Thanks.

YJ-142150 commented 1 year ago

Thanks for answering the question!