InvokeAI: Error thrown running `dream.py` on main branch `ModuleNotFoundError: No module named 'ldm'`
When trying to run the dream.py
file on the current main
branch, I get the following error:
/content/stable-diffusion# pipenv run scripts/dream.py
Traceback (most recent call last):
File "scripts/dream.py", line 12, in <module>
import ldm.dream.readline
ModuleNotFoundError: No module named 'ldm'
Environment: Google Colab & Docker (WSL2 + GPU passthrough) Python 3.8.13
The error that was outputted above came from the google colab environment on the main branch (removed line that checked out a specific tag).
I’ve been working in a docker container and thought maybe it had something to do with not using conda, but I tried the colab notebook in the Colab env, and removed the line to checkout the specific tag, and encountered the same error, so I am fairly certain it’s an issue with the current branch rather than an env issue.
When I ran the same line on tags/release-1.09
, it showed the initialization message
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 29 (10 by maintainers)
The original problem happens because
conda
adds the current path toPYTHONPATH
. You can fix the error with:Well, it got you 50% of the way there…
Some other things to try:
sys.path.append(‘/path/to/stable-diffusion’)
(replace with the actual path to the stable-diffusion directory)
Let me know if you find a working solution. This has probably been the most elusive of bugs in the fork, and I wish I could get to the bottom of it.
Lincoln
On Wed, Aug 31, 2022 at 11:16 PM Mark V @.***> wrote:
–
Lincoln Stein
Head, Adaptive Oncology, OICR
Senior Principal Investigator, OICR
Professor, Department of Molecular Genetics, University of Toronto
Tel: 416-673-8514
Cell: 416-817-8240
@.***
E**xecutive Assistant
Michelle Xin
Tel: 647-260-7927
@.*** @.**>
Ontario Institute for Cancer Research
MaRS Centre, 661 University Avenue, Suite 510, Toronto, Ontario, Canada M5G 0A3
@OICR_news https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Foicr_news&data=04|01|Michelle.Xin%40oicr.on.ca|9fa8636ff38b4a60ff5a08d926dd2113|9df949f8a6eb419d9caa1f8c83db674f|0|0|637583553462287559|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=PS9KzggzFoecbbt%2BZQyhkWkQo9D0hHiiujsbP7Idv4s%3D&reserved=0 | www.oicr.on.ca
Collaborate. Translate. Change lives.
This message and any attachments may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this message in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this message may not be that of the organization.
The fixed colab works well thank you!
My PR #422 was just merged to development branch, until development is merged to main, colab shortcut will redirect to previous version, please use this link in the meantime.
https://colab.research.google.com/github/lstein/stable-diffusion/blob/development/Stable_Diffusion_AI_Notebook.ipynb
https://github.com/lstein/stable-diffusion/releases/tag/release-1.13
That’s the plan going forward.
@artmen1516;
Yes, that is the case - I don’t know how that happened. Your advice for checking out a different commit is sound. Note that we’re still trying to figure out what ‘requirements.txt’ should contain, and recently in f4004f6 (merged to ‘development’) split it per-platform (so for e.g. for Colab it would be ‘requirements-lin.txt’)
Hey @Bendito999 @vanakema, I made the colab notebook, I just noticed that it is failing, this is because the repo owners changed where the tag release-1.09 was pointing when I made the notebook… I made it checkout to this tag since there were a lot of changes being made on real time and sometimes it worked correctly and other times it didn’t, so to avoid errors I decided to use an stable tag.
Based on my analysis, this is where it is pointing now, and where it was then.
Let me know if i’m right @tildebyte @lstein
In the previous pointer commit there were changes made to the requirements.txt file which installed all dependencies correctly. Newer tags have issues with the dependencies which are still not resolved. You could checkout to the previous commit that tag 1.09 was using.
Use this notebook in my fork where i do what I explain, it is working as it used to… artmen1516/stable-diffusion/blob/colab-notebook-fix/Stable_Diffusion_AI_Notebook.ipynb
I don’t want to open a PR with this as a solution, since is not the best to use an specific commit, I will work to make it work with the lastest release, but in the meantime, this is a workaround to use the notebook.
Note: I didn’t use conda since I understand that conda takes a lot more memory and hence installation time, and the point with the notebook is to have something relatively fast to test the repo.