LAION-AI / ldm-finetune

Home of `erlich` and `ongo`. Finetune latent-diffusion/glid-3-xl text2image on your own data.
MIT License
182 stars 19 forks source link

Running Erlich.pt model results in error. #3

Closed KnoBuddy closed 2 years ago

KnoBuddy commented 2 years ago

When I run:

! python sample.py --clip_guidance --model_path elrich.pt --guidance_scale 25.0 --seed -1 --batch_size 1 --num_batches 100 --text "a cyberpunk girl with a scifi neuralink device on her head"

Gives me the error:

Traceback (most recent call last): File "sample.py", line 341, in <module> model_state_dict = torch.load(args.model_path, map_location="cpu") File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 699, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 231, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 212, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'elrich.pt'

Maybe this has to do with LFS? I haven't tried installing the models to the machine I'm still using the pointers. Idk if that's the issue.

I am already in well over my head here trying to absorb and learn as much as I can as I go.

Edit: Okay I tried installing and initializing lfs and running:

! python sample.py --clip_guidance --model_path erlich.pt --guidance_scale 25.0 --seed -1 --batch_size 1 --num_batches 100 --text "ta cyberpunk girl with a scifi neuralink device on her head"

Now I get a different error:

Traceback (most recent call last): File "sample.py", line 341, in <module> model_state_dict = torch.load(args.model_path, map_location="cpu") File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

KnoBuddy commented 2 years ago

After about 4 new repositories and colab notebooks I am seeing results with Erlich.

! pip install omegaconf>=2.0.0 pytorch-lightning>=1.0.8 torch-fidelity einops

Seemed to sometimes not install correctly or was corrupted while installing other packages.