Skip to content
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

Test Issue #16

Open
TyzMatty opened this issue Nov 27, 2022 · 8 comments
Open

Test Issue #16

TyzMatty opened this issue Nov 27, 2022 · 8 comments

Comments

@TyzMatty
Copy link

Hi, so I got through all the steps until the last one, testing to make sure it works.
When I enter python dream-factory.py --prompt_file prompts/example-standard.prompts
I get the following

(dream-factory) C:\Users\blade\dream-factory>python dream-factory.py --prompt_file prompts/example-standard.prompts
Traceback (most recent call last):
File "C:\Users\blade\dream-factory\dream-factory.py", line 19, in
import scripts.utils as utils
File "C:\Users\blade\dream-factory\scripts\utils.py", line 22, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'

As far as I know, I did the setup correctly so I'm kind of at a loss.
I'm using Windows 10 and appreciate any help I can get.
If possible please explain any fixes simply, I'm very new at this so my knowledge is quite limited. Thanks in advance!

@relh
Copy link

relh commented Nov 27, 2022

Looks like your python cant find the Pillow package which is imported as PIL.

The fix here is probably pip install Pillow but depends on your OS if that works. Can also do conda install Pillow probably.

@TyzMatty
Copy link
Author

Update, Pip didn't seem to help but doing conda gave this output.

Collecting package metadata (current_repodata.json): done
Solving environment: done
All requested packages already installed.
Retrieving notices: ...working... done

And then when trying the test line again, I got the following.

Traceback (most recent call last):
File "C:\Users\blade\dream-factory\dream-factory.py", line 26, in
from torch.cuda import get_device_name, device_count
ModuleNotFoundError: No module named 'torch'

@relh
Copy link

relh commented Nov 27, 2022

Ahh okay cool!

I think that something went wrong between steps [3] and [4] then. You probably want to rerun python setup.py from inside the dream-factory directory.

When you run python setup.py you should see it install a bunch of packages, including torch. You can read the file here and see that command being issued at line 54: https://github.com/rbbrdckybk/dream-factory/blob/main/setup.py

Another helpful hint is that if you ever see a python error, like ModuleNotFoundError: No module named 'torch', you can usually just put it into Google and find an answer.

@TyzMatty
Copy link
Author

After doing pip install for both torchvision and cherrypy, It's stopped giving module errors. It's now saying this

(base) C:\Users\blade\dream-factory>python dream-factory.py --prompt_file prompts/example-standard.prompts
[controller] >>> configuration file 'config.txt' doesn't exist; using defaults...
[controller] >>> starting webserver (http://localhost) as a background process...
[controller] >>> detected 0 total GPU device(s)...
[controller] >>> ERROR: unable to initialize any GPUs for work; exiting!

Now I'm pretty sure I have a gpu, though its not great, but the fact that it can't find it at all is a bit odd.

@relh
Copy link

relh commented Nov 27, 2022

It has to be a NVIDIA GPU, at least for the version of PyTorch that gets installed through setup.py. You might be able to run everything on the CPU, though it will be a bit slower -- you just need to install a version of PyTorch designed for the CPU.

There's a service called Google Colab (https://colab.research.google.com/) that lets you run programs for free using a Nvidia GPU. You might be able to get that to work.

@rbbrdckybk
Copy link
Owner

It looks like you have no config.txt file, which should have been created as the last step of the setup process (when you ran setup.py - definitely sounds like this is not completing properly for you). You can create it yourself by just renaming config-default.txt to config.txt. Assuming you do have an Nvidia GPU, that might fix the issue.

@TyzMatty
Copy link
Author

I've definitely got an Nvidia gpu, so I don't know why its saying no gpu detected.
I renamed config-default to config and its basically the same issue, though now it says its reading from config instead of saying it doesn't exist and using defaults.
It's not as if the gpu is busy either, its doing nothing
image
Trying to make config use GPU 0 makes it output

[controller] >>> reading configuration from config.txt...
[controller] >>> starting webserver (http://localhost:8080/) as a background process...
[controller] >>> unable to initialize device 'cuda:0'; removing it as a GPU candidate...
[controller] >>> ERROR: unable to initialize any GPUs for work; exiting!

Sorry for the continued questions, I just don't know how to fix it on my own. I'm looking into a cpu pytorch version so I'll update if that works.

@rbbrdckybk
Copy link
Owner

Given that you have an Nvidia GPU and Dream Factory doesn't see it, the most likely explanation is that Pytorch wasn't installed properly. Did you see any errors when you ran setup.py?

Try running setup again with the verbose option and see if you catch any obvious errors:

python setup.py --force --shell --verbose

Alternatively, you can try installing pytorch manually:

conda install -y pandas pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

If there is a failed/leftover old installation you may need to start fresh with a new conda environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants