question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated images are completely black?! 😵 What am I doing wrong?

See original GitHub issue

Hello, I am on Windows 10, and my gpu is a PNY Nvidia GTX 1660 TI 6 Gb. I installed Big Sleep like so:

  • conda create --name bigsleep python=3.8
  • conda activate bigsleep
  • conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch (as per Pytorch website instructions)
  • pip install big-sleep

The problem is that when I launch dream --text="a beautiful mind" --num-cutouts=64 --image-size=512 --save_every=10 --seed=12345 the generated images are completely black (although the inference process seems to run nicely and without errors).

Things I’ve tried:

  • installing previous pytorch version with conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
  • removing the big-sleep conda environment completely and recreating it anew
  • uninstalling nvidia drivers and performing a new clean driver install (I tried both Nvidia Studio drivers and Nvidia Game Ready drivers)
  • uninstalling and reinstalling Conda completely

But nothing helped… and at this point I don’t know what else to try…

The only interesting piece of information I could gather is that for some reason this problem also happens with another text-to-image project called v-diffusion-pytorch where similar to Big Sleep the inference process appears to run correctly but the generated images are all black.

I think there must be some simple detail I’m overlooking… which it’s making me go insane… 😵 Please let me know something if you think you can help! THANKS !

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
illtellyoulatercommented, Mar 25, 2022

I fixed it!

Apparently the problem was that the cuda toolkit version I was installing with the conda package (11.3) was not recent enough to match my video drivers.

So I uninstalled the conda packages for torch, torchvision and cudatoolkit, and I installed torch and torchvision via pip, paying attention to pick a version which embedded a much more recent cuda toolkit version (11.5):

pip3 install torch==1.11.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html pip3 install torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html

Now I can happily dream! 😉 Thanks again for your help and to all those who have worked on this!

Btw, the other project which was also generating black images (glide-text2im), did not benefit from this fix, so it was just a coincidence! And it has to be caused by something else…

2reactions
MrPalaiscommented, Apr 21, 2022

@illtellyoulater I had to reinstall numpy 1.22.3, but your trick works, thanks a lot 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated images are completely black?! 😵 What am I doing ...
Hello, I am on Windows 10, and my gpu is a PNY Nvidia GTX 1660 TI 6 Gb. ... appears to run correctly...
Read more >
How to Fix Half/Full Grey or Black Photos Easily [2022]
Solution 4: Repair half grey picture with Command Prompt · 1. Prompt Windows search box and enter Command Prompt or CMD. run command...
Read more >
Why did my image RANDOMLY go BLACK & WHITE in Adobe ...
UNLOCK YOUR CREATIVITY - 2 MONTHS FREE ON SKILLSHARE - https://bit.ly/ben-on-skillshare△ Watercolor Brushes for Photoshop: ...
Read more >
AI can't color old photos accurately. Here's why - Scienceline
With names like DeOldify, DeepAI and Algorithmia, they can color a black-and-white photo in just a few seconds.
Read more >
AI Image Generator: The Problematic Truth Behind the Trend
Feeling Uncomfortable About All These AI-Generated Images? ... “Do some research about the privacy policy” to find out what a company may do ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found