-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error thrown running dream.py
on main branch ModuleNotFoundError: No module named 'ldm'
#272
Comments
dream.py
cannot be run on main branchdream.py
on main branch ModuleNotFoundError: No module named 'ldm'
This seems to be a common problem when the initial install didn't complete for whatever reason. Recommended solutions are to run "conda env update -f environment.yaml" or "pip install -e ." If neither of these works, then the hack is to take dream.py out of the scripts directory, put it in the top-level stable-diffusion directory, and run it from there. It's possible that something did get broken in the latest update, and I'd be interested in hearing from other Colab and Docker users whether this is a new problem that appeared. There have been so many updates over the past 48 hours (in a mostly good feature-adding way) that I wouldn't be surprised. |
I had previously tried I'll try my docker container on one of the existing releases |
I retried |
Well, it got you 50% of the way there...
Some other things to try:
1. Have you tried putting the full path to stable-diffusion in the
environment variable PYTHONPATH?
2. Edit the file dream.py and put this at or near the top of the file:
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:
I retried -e on my docker container just to make sure I didn't do
something big dumb, but same result
—
Reply to this email directly, view it on GitHub
<#272 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3EVKIWF2A26TPJUH6EEDV4AN2HANCNFSM6AAAAAAQB5MCAA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
*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%7C01%7CMichelle.Xin%40oicr.on.ca%7C9fa8636ff38b4a60ff5a08d926dd2113%7C9df949f8a6eb419d9caa1f8c83db674f%7C0%7C0%7C637583553462287559%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&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.
|
Using the latest release tag in my docker container allowed the initializing message to show in my docker container, but then it failed with Adding Btw thanks for all your work on this. Very cool enhancements to the original repo |
Doing |
Hit the same issue with
Had to add |
Something which should be automatically modifying the path isn't. Unfortunately, given the complexity of your environment, it's really hard to say what (candidates are: conda, pip, pipenv, colab itself... I don't really understand how docker is involved in this, but the any paths set in the container's Dockerfile might have an issue) |
The environment isn't actually that complex. Not using conda and not using pipenv (that's part of why I use docker). Not using Colab; Colab was just a separate environment I tried running to see if it was an env issue. I'll push to my fork later tonight to let you guys see the Dockerfile and what commands I run to use it. |
In case this helps anyone else, I resolved this on an M1 mac by just installing Anaconda from https://www.anaconda.com/ |
Yeah that makes some sense, I had a hunch that it had something to do with the way that modules in Anaconda environments are handled. The reason I'm still confused is because the colab notebook just uses pipenv, not conda, and it works fine after running 'pip install -e .' |
I use pip-only on baremetal Win 11/RTX 2070 8G VRAM in a pew environment (which under the covers is a standard virtualenv) - I have no issues. @vanakema; Can you explain your exact environment? You've mentioned Google Colab, Docker, WSL2, GPU passthrough, conda, pip... What is your host environment (OS & ver, GPU & VRAM)? In which exact environment are you trying to actually run the 'dream' script? |
Sure. It's just what I said in my first post, though I understand the confusion of the two separate environments. Sorry for the confusion. Primary environment tested in: Secondary environment tested in as a sanity check: I am not using conda. I mentioned not using conda because it's specifically mentioned in the readme, so I wanted to call out that the lack of using conda was a suspect of mine, but the Colab environment (and yours) proves otherwise. However, ultimately the host env should have no affect on python module import issues in a docker container |
Let me know if there's any other pieces of my env you want more details on. |
Hey @tildebyte, I was reviewing your "easy peasy" Windows guide just now
and am wondering whether the requirements.txt in the distribution should
just be replaced by the one in your guide?
Lincoln
…On Thu, Sep 1, 2022 at 6:42 PM tildebyte ***@***.***> wrote:
I use pip-only on baremetal Win 11/RTX 2070 8G VRAM in a pew environment
(which under the covers is a standard virtualenv) - I have no issues.
@vanakema <https://github.com/vanakema>; Can you explain your *exact*
environment? You've mentioned Google Colab, Docker, WSL2, GPU passthrough,
conda, pip... What is your *host* environment (OS & ver, GPU & VRAM)? In
which *exact* environment are you trying to actually run the 'dream'
script?
—
Reply to this email directly, view it on GitHub
<#272 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3EVKVOUETIPTNRWFS5HDV4EWMHANCNFSM6AAAAAAQB5MCAA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
*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%7C01%7CMichelle.Xin%40oicr.on.ca%7C9fa8636ff38b4a60ff5a08d926dd2113%7C9df949f8a6eb419d9caa1f8c83db674f%7C0%7C0%7C637583553462287559%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&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.
|
Honestly, I think you’d be better off running on native Windows using the instructions from the wiki. The only “invasive” (i.e. outside of a Python virtual environment) things you’d have to install would be Python 3.10, Git for Windows, Windows Terminal, and Powershell 7. The latter 2 are things which Windows should have anyway, IMO (and probably will be, before too long). |
I have no objection, but I did (slightly sneakily) base on Python 3.10 (I had to update torch and numpy, and maybe one other package (diff should tell)). Point being; if we replace the main reqs file, we should probably require 3.10 for all platforms (it seems like the Mac users are already on 3.9 or 3.10), and for conda (which I personally have not tested past 3.8) |
The original problem happens because
|
🤨 |
Has anyone gotten this to work in the current Colab? Whenever I try to run it it will act like various parts aren't installed, such as pytorch_lightning even though I'll manually install that. It seems inconsistent too, but I'm new to Colab, was just curious if it is in a working state right now because if I follow it straight through currently it's always missing something (Sometimes seems to be missing Conda, and if I try to install that I can, but then manually running conda env update -f environment.yaml takes forever |
I got it to work just the other day. The key was to run the pip install commands again from the xterm in the last step if you have issues with missing does. Also I don't think the colab environment should be using conda. It uses pipenv by default |
Thanks I do that but it still seems to break, just can't get pytorch running. If I manually try to install pytorch_lightning which is the part the script thinks is missing it seems like that installs fine Regarding just pytorch though I can't get past the wheel error, and I wonder if it is because the Colab is on Python 3.7 instead of 3.8 Just haven't been able to figure it out yet but if anyone has run this colab successfully let me know what commands you had to put in to do so. Thanks. |
Oh interesting. I got that legacy command error before, and it was when I tried to use python 3.10 instead of 3.8. This was in my own local docker env though so I’m not sure if that is your prob here. I’m pretty sure my Colab was running 3.8.x and it worked fine. I’m not quite sure why yours is running 3.7. However, I am pretty sure that it has something to do with your python version |
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... 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. Use this notebook in my fork where i do what I explain, it is working as it used to... 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. |
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') |
@tildebyte Also, it would be nice to have static releases instead of tags that can change. |
https://github.com/lstein/stable-diffusion/releases/tag/release-1.13 That's the plan going forward. |
My PR #422 was just merged to development branch, |
The fixed colab works well thank you! |
When trying to run the
dream.py
file on the currentmain
branch, I get the following error: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 messageThe text was updated successfully, but these errors were encountered: