alembics / disco-diffusion

Other
7.47k stars 1.13k forks source link

New OpenCLIP Settings work ONLY during same run that open_clip package is first installed. #126

Closed codehearted closed 1 year ago

codehearted commented 2 years ago

I just started using DD 5.6 (after using 5.4 for while) running locally on Ubuntu 18.04, and everything usually works fine, but the first time I tried using the new OpenCLIP settings, it crashed giving the error:

AttributeError: module 'open_clip' has no attribute 'create_model'

Although, when looking through the source I can see clearly that the module open_clip does indeed have an attribute create_model, imported in the init from factory etc.. I heard on the discord someone mention that they had the same error on Colab, and they found that either just restarting the runtime, or re-installing, or attaching wiped storage fixed it.

Through experimentation I discovered that I can make this error go away by deleting the open_clip directory and forcing DD to re-install it on the next run, and for that run only it works with OpenCLIP settings. But the next run, it breaks again with the same error. This happens every time. I have to delete the open_clip directory in order to get those settings to work. Thankfully DD does seem to be able to batch multiple images without crashing on the second or subsequent ones, so I am hoping it will also do an animation, without breaking on subsequent images during the same run - I will test that soon and update this issue with the results.

UPDATE 7/15/22: Animations do work.

So, for now, I have to delete the open_clip folder again, and let it install it again on each run in order to get it to work with these new toys. This problem also goes away if I set all of the OpenCLIP settings to False, but that defeats the purpose, I want to be able to use them. OpenCLIP re-installs quickly, and doesn't have to re-download any of the large files that it did the first time I set each setting to True, so I don't mind that much, but I thought it was important to report.

As a temporary solution, I have just changed my command line to run DD to be:

rm -Rf open_clip/; python -m disco.py

That works, but there has to be a better way.

PS - Thank you so much for releasing Disco Diffusion!

codehearted commented 1 year ago

This is a small issue, I'm not sure it affects anyone else, and I can certainly live with it so to ease the burden on developers and in hopes of seeing future development I'm gonna just close this issue. It's not important compared to the rest of keeping disco diffusion alive.