Disco Diffusion Errors

If you run into any errors while trying to run Disco Diffusion from my tutorial, you can ask here and I will try to answer them as soon as I can. I will also list common errors here for everyone to see.

166 Comments

  1. I have an error on step 9 (windows):

    Looking in links: https://download.pytorch.org/whl/cu113/torch_stable.html
    warning: missing-index-doctype

    × The package index page being used does not have a proper HTML doctype declaration.
    ╰─> Problematic URL: https://download.pytorch.org/whl/cu113/torch_stable.html

    note: This is an issue with the page at the URL mentioned above.
    hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
    ERROR: Could not find a version that satisfies the requirement torch==1.10.2+cu113 (from versions: none)
    ERROR: No matching distribution found for torch==1.10.2+cu113

  2. download 404
    you are no longer hosting the project download; common sense workarounds such as removing the filename from the download url and attempting to visit the index page for the hoster – tried and failed.

    thanks.

  3. hi there, thank you for your effort.
    my problem with your approach is:
    – use_cpu = False results in the harsh realization that my GPU is not good enough to run even a 512×512 image (nvidia 1070 ti)
    but setting: use_cpu = False results in an error that i can not fix with my limited knowledge of torch.

    Before we might go into detail, just generally asking: the CPU mode is running for you? Or is this a problem on my side? (Ubuntu machine)

    Very

    • I need the error it gives you, otherwise it’s hard to fix. I don’t run on CPU, it takes a VERY long time, but if editing the use_cpu=False line (226) in the code to use_cpu=True doesn’t fix it, you will need to find line 1032 and edit the whole line to “fp16 = False” and that should fix everything.

    • With cpu only i can render, but the gpu i have no idea what torch is and how to make it work, i get this error only now, any help is appreciated.
      AssertionError: Torch not compiled with CUDA enabled

      • Use this page to find the right command to install torch: https://pytorch.org/get-started/locally/

        • Hi There

          I am getting this Error “AssertionError: Torch not compiled with CUDA enabled”

          I have followed the instruction on Start Locally Pytorch page. The ironic thing is I did a reinstall of windows 10 today as I need to adjust how I was using my system so a clean install was the way to go. but yesterday on the “old” install everything was working perfectly.

          System is a i9, RTX 3090.
          running CUDA 11.6
          Python 3.9

          I have uninstalled PyTorch, purged the cache and done reinstalls. but to no avail, though really its likely I am doing something dumb.

          • Use “pip3 install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113 –force-reinstall”

          • Thanks so far for your help, I am still getting this.
            AssertionError: Torch not compiled with CUDA enabled

            Tried this to force reinstall (WSC didn’t like your version)
            pip install –force-reinstall torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113

            Did an entirely clean build of the PC (Its the weekend and I had nothing better to do 🙂 ). In the order I installed thngs

            Installed Windows 10 Home Edition – then did all the updated to 21H2
            Installed Visual Studio
            Installed Nvidia Cuda SDK 11.3
            Installed Python 3.9

            Installed Windows Studio Code:
            Opened as Admin
            Loaded main.py
            Python3 -m venv venv
            had a permission issue even though this accound is a adm “Get-ExecutionPolicy” changed to “set-ExecutionPolicy remotesigned”

            from cmd :
            Python -m pip install –upgrade pip

            python3 -m pip install lpips
            python3 -m pip install ftfy
            python3 -m pip install regex
            python3 -m pip install matplotlib
            python3 -m pip install ipywidgets

            Python3 -m pip3 install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113

            Ran Python3 main.py errored out “AssertionError: Torch not compiled with CUDA enabled”

            Used the force reinstall
            pip install –force-reinstall torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113

            Ran again the Python3 main.py and it still errored out “AssertionError: Torch not compiled with CUDA enabled”

            I know your setup really works 🙂 just going a bit mental that, its doing this.

          • Other than that, I actually don’t know, hopefully someone else can help. I’d also suggest asking the the pytorch subreddit

          • AA possible solution

            AssertionError: Torch not compiled with CUDA enabled

            Installed Cuda 11.3, still got the issue . but also had another error “WARNING: Ignoring invalid distribution -orch”

            So the solution to that one which seems to have had an onflow effect on the Cuda issue…

            Check in the “Venv/lib/site packages” for anything that looks like “~Whatever” folder and delete it.

            re run part 8, 9 and 10 and you should … in theory be up and running

            Thanks Eliso 🙂 You help, patience and excellent install is just brilliant 🙂

  4. Hi,
    im new to python and VS and all and am having an error where Line 164 gives me- ModuleNotFoundError: No module named ‘timm’
    Where do i have to place the main folder to begin with (directory?) I just placed all the content of the main folder inside the- C:\Users\MyName folder and installed everything somehow.
    /I’m using windows 7 with python 3 .7 .7
    -python3 main.py does not work for me so I tried- python main.py and the things worked.
    I would be grateful if you answer my questions,
    thank you!

    • Type “python3 -m pip install timm” in the terminal.

      • Thanks for the reply eliso,
        The term ‘python3’ is not recognized as the name of a cmdlet and so on….
        that is why i have been typing “python” only. Win7 wont see python3. and i did have the variable inserted to the Path section of the Win variables “;C:\Program Files\Python37\;C:\Program Files\Python37\Scripts\”

  5. Debugger said: line 191- Exception has occurred: ModuleNotFoundError
    No module named ‘timm’
    File “C:\Users\Andi\main.py”, line 191, in
    import timm

  6. I think i got it, i need to install
    pip install lpips
    pip install ipywidgets
    pip install pips
    pip install matplotlib
    and god knows what else..i thought they were all installed and ready to use but nope

  7. I got everything but this to fix
    AssertionError: Torch not compiled with CUDA enabled
    Any ideas?

  8. i need visual studio before that right? My cuda now is 9.0.176 and not listed on this site. Am i f***d

  9. Hi! I’d like some pointers on how to fix the CUDA out of memory issue. It managed to run until the moment it generates the first iteration, but it returns this error:

    RuntimeError: CUDA out of memory. Tried to allocate 1.76 GiB (GPU 0; 8.00 GiB total capacity; 5.12 GiB already allocated; 1.05 GiB free; 5.37 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    • For an 8GB GPU, you really can’t run much, you will need to go to line 1131 and change it to “width_height = [448, 448]”

      • Thanks, I played around with the settings and managed to get up to 1280×640 by only loading one CLIP model (ViTB32). Could still push some awesome art with this limited hardware. Really appreciate the guide!

  10. I can’t go past step 5. I have installed python3 (correct bit, os, all that) but when I type “python3 -m venv venv” in VS code I get this error:

    Python was not found; run without arguments to install from the Microsoft Store, or disable this
    shortcut from Settings > Manage App Execution Aliases.

    What can be done?

    • When installing, you need to select “add to PATH” (or similar text), if you did that, you may need to restart your computer, if that also fails, you need to install python from the microsoft store instead.

      • I appreciate the answers eliso & andon. I added to PATH and typed “pyton” (removing the 3). This worked. However immediately an error on step 6. Using Windows, I type: source .venv/Scripts/activate.ps1

        Get this error:

        source : The term ‘source’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
        spelling of the name, or if a path was included, verify that the path is correct and try again.
        At line:1 char:1
        + source .venv/Scripts/activate.ps1
        + ~~~~~~
        + CategoryInfo : ObjectNotFound: (source:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

    • i used “python” without the 3, and it worked (using CPU)

  11. Hi Eliso,
    Thanks for the great job here!

    I’m stuck at the step 11, when I type python3 main.py in the terminal.
    The terminal says python3.exe can’t open file ‘C:\Users\myname\main.py’: : [Errno 2] No such file or directory

    Is there a way to specify directly the folder where main.py is stored? Or is it something else I messed up?

    Thanks a lot for your time!

  12. Hi Eliso,

    Could you please help me. I’m new to coding.

    I’m stuck at ‘2.1 Install and import dependencies’

    I got an error:
    ModuleNotFoundError Traceback (most recent call last)
    s:\Program Files\DD\main\main.py in ()
    189 import io
    190 import math
    —> 191 import timm
    192 #from IPython import display
    193 import lpips

    ModuleNotFoundError: No module named ‘timm’

    • I have dealt with it.

      But there is another problem which I can’t find the solution for on internet.

      NameError Traceback (most recent call last)
      s:\Program Files\DD\main\main.py in ()
      1074 model_default = model_config[‘image_size’]
      1078 if secondary_model_ver == 2:
      –> 1079 secondary_model = SecondaryDiffusionImageNet2()
      1080 secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
      1081 secondary_model.eval().requires_grad_(False).to(device)

      NameError: name ‘SecondaryDiffusionImageNet2’ is not defined

      • I executed ‘python main.py’ and got the error:

        File “S:\Program Files\DD\main\main.py”, line 1080, in
        secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
        TypeError: load_state_dict() missing 1 required positional argument: ‘state_dict’

        Could you help please.

  13. I’m trying to run this on an RTX 2070 (8GB VRAM; not a lot), and I scaled down `width_height` to just `[64, 64]` but I’m still getting the following error:

    “`RuntimeError: CUDA out of memory. Tried to allocate 24.00 MiB (GPU 0; 7.79 GiB total capacity; 4.93 GiB already allocated; 46.00 MiB free; 5.21 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF“`

    Is there anything I can do about this, or do I just need a better GPU?

  14. I started using DD on my PC using my 3090 and was working well for a while. Now I loaded it up for another go and I get this error when trying to run it:

    OSError: [WinError 193] %1 is not a valid Win32 application. Error loading “C:\Users\steyr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\torch\lib\cudnn_cnn_infer64_8.dll” or one of its dependencies.

    Any ideas?

  15. I have ModuleNotFoundError: No module named ‘PIL’
    and I have installed Pillow==9.0.1
    pip==22.0.4

  16. hey getting this error on step 6

    PS C:\DiscoDiffusion\main> ./venv/Scripts/activate.ps1
    ./venv/Scripts/activate.ps1 : File C:\DiscoDiffusion\main\venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system.
    For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + ./venv/Scripts/activate.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

  17. Traceback (most recent call last):
    File “c:\Windows\System32\main\main.py”, line 1084, in
    if ViTB32 is True: clip_models.append(clip.load(‘ViT-B/32’, jit=False)[0].eval().requires_grad_(False).to(device))
    AttributeError: module ‘clip’ has no attribute ‘load’

  18. Thanks again for the documentations.
    Do I have to install Visual Studio and CUDA toolkit for this?

    When I’m running main.py I get this!

    RuntimeError: CUDA error: unknown error
    CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
    For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

    • That is actually an out of memory error (very confusing error), if it isn’t an out of memory error, it could also mean wrong overclocking.

      • Thanks for the reply,
        I have RTX3080 and 64G Ram
        And I don’t do overclocking. Do you know if there is anyway to terminate any running cuda before using this!? or something to free CUDA with!
        I’m not running any other app!

        • VRAM memory, not RAM, and to remove all VRAM, type “nvidia-smi” and then, for each number it shows you on the left, put “kill number” replacing number with the code listed.

  19. i met mistakes on step3
    here’s the code
    【Checking 512 Diffusion File
    512 Model SHA matches
    Checking Secondary Diffusion File
    Secondary Model SHA matches
    —————————————————————————
    NameError Traceback (most recent call last)
    in ()
    136
    137 if secondary_model_ver == 2:
    –> 138 secondary_model = SecondaryDiffusionImageNet2()
    139 secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
    140 secondary_model.eval().requires_grad_(False).to(device)

    NameError: name ‘SecondaryDiffusionImageNet2’ is not defined】

    • I haven’t actually seen this error before, hopefully someone else can help you, maybe try posting in the disco diffusion reddit.

  20. hello, i have that error on step 2 on DD with colab pro:

    SSLCertVerificationError Traceback (most recent call last)

    /usr/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
    1349 h.request(req.get_method(), req.selector, req.data, headers,
    -> 1350 encode_chunked=req.has_header(‘Transfer-encoding’))
    1351 except OSError as err: # timeout error

    21 frames

    SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1091)

    During handling of the above exception, another exception occurred:

    URLError Traceback (most recent call last)

    /usr/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
    1350 encode_chunked=req.has_header(‘Transfer-encoding’))
    1351 except OSError as err: # timeout error
    -> 1352 raise URLError(err)
    1353 r = h.getresponse()
    1354 except:

    URLError:

  21. As of yesterday on DD 5.0 I cant get past the cell to define necessary functions. seems things to be missing now

    —————————————————————————
    ModuleNotFoundError Traceback (most recent call last)
    in ()
    4
    5 import pytorch3d.transforms as p3dT
    —-> 6 import disco_xform_utils as dxf
    7
    8 def interp(t):

    /content/disco_xform_utils.py in ()
    1 import torch, torchvision
    —-> 2 import py3d_tools as p3d
    3 import midas_utils
    4 from PIL import Image
    5 import numpy as np

    ModuleNotFoundError: No module named ‘py3d_tools’

    —————————————————————————
    NOTE: If your import is failing due to a missing package, you can
    manually install dependencies using either !pip or !apt.

    To view examples of installing some common dependencies, click the
    “Open Examples” button below.
    —————————————————————————

  22. I’m trying to run it localy but there’s something missing, and I have no clue what should I do:

    Cloning into ‘pytorch3d-lite’…
    fatal: destination path ‘ResizeRight’ already exists and is not an empty directory.
    Cloning into ‘MiDaS’…
    Cloning into ‘disco-diffusion’…
    ‘wget’ is not recognized as an internal or external command,
    operable program or batch file.
    —————————————————————————
    ModuleNotFoundError Traceback (most recent call last)
    c:\Users\c\Downloads\main\main\Copia_di_{WSL}_Disco_Diffusion_v5_[w_3D_animation].ipynb Cell 11′ in
    80 from dataclasses import dataclass
    81 from functools import partial
    —> 82 import cv2
    83 import pandas as pd
    84 import gc

    Thanks

    • You need to install wget for windows, then restart your computer, then try.

      • Thanks Eliso,

        I installed wget and checked if it works, but I still get some errors:
        —————————————————————————
        ModuleNotFoundError Traceback (most recent call last)
        c:\Users\cedomir\Downloads\main\main\Copia_di_Disco_Diffusion_v5_1_[w_Turbo].ipynb Cell 13′ in
        59 from dataclasses import dataclass
        60 from functools import partial
        —> 61 import cv2
        62 import pandas as pd
        63 import gc

        ModuleNotFoundError: No module named ‘cv2’

        Please help
        Thanks

  23. I’m getting a “ModuleNotFoundError: No module named ‘resize_right'” error.
    I’ve solved the other Module not found errors and don’t understand why this one is different as it’s in the sub folder

  24. Hi, I got this error while doing step 4
    model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’))

    RuntimeError Traceback (most recent call last)
    in ()
    160 print(‘Prepping model…’)
    161 model, diffusion = create_model_and_diffusion(**model_config)
    –> 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’))
    163 model.requires_grad_(False).eval().to(device)
    164 for name, param in model.named_parameters():
    ———————————— 1 frames—————————————
    /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
    240 class _open_zipfile_reader(_opener):
    241 def __init__(self, name_or_buffer) -> None:
    –> 242 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
    243
    244

    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

    thanks~

    • Never seen this error before, hopefully someone else can help you solve it.

    • I also met the same problem. Maybe it’s timeout, because I used vpn to connect to colab and the connection is weak.

      RuntimeError Traceback (most recent call last)

      in ()
      160 print(‘Prepping model…’)
      161 model, diffusion = create_model_and_diffusion(**model_config)
      –> 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’))
      163 model.requires_grad_(False).eval().to(device)
      164 for name, param in model.named_parameters():

      1 frames

      /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
      241 class _open_zipfile_reader(_opener):
      242 def __init__(self, name_or_buffer) -> None:
      –> 243 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
      244
      245

      RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

    • I met the same problem. Have you solved it? with appreciate:)

  25. im on windows and when i do the pip install on requirement.txt it throws this:

    ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: ‘C:\\Users\\name\\AppData\\Local\\Temp\\pip-uninstall-8prdf_s8\\pip3.exe’
    Check the permissions.

  26. Ok for some reason after getting no where, I took a few days to play with other things unrelated to this “AssertionError: Torch not compiled with CUDA enabled” error.

    Use the Pytorch.org tool, but added the “–upgrade” into the Pip

    pip3 install –upgrade torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113

    and finally I am back up and running again 🙂 just thought I would share 🙂

  27. Hello, Hi, I got this error while doing running ‘main.py’ in step 11.
    —–
    (venv) PS D:\disco\disco-diffusion-main> python3 main.py
    D:\disco\disco-diffusion-main\main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
    if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
    filepath ./content/init_images exists.
    filepath ./content/images_out exists.
    filepath ./content/models exists.
    Traceback (most recent call last):
    File “D:\disco\disco-diffusion-main\main.py”, line 193, in
    import lpips
    ModuleNotFoundError: No module named ‘lpips’

  28. So grateful for this resource — thanks!!

    I’m getting an error on Step 8. The full error message is posted below. Can you help?

    (venv) PS C:\Users\domin\Dropbox\My PC (DESKTOP-OMDF9L9)\Downloads\main\main> pip3 install -r requirements.txt
    Traceback (most recent call last):
    File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 87, in _run_code
    exec(code, run_globals)
    File “C:\Users\domin\Dropbox\My PC (DESKTOP-OMDF9L9)\Downloads\main\main\venv\Scripts\pip3.exe\__main__.py”, line 4, in
    ModuleNotFoundError: No module named ‘pip._internal’

  29. Thanks for this great tutorial, when running the requirements. txt I got this

    “ERROR: Could not find a version that satisfies the requirement pywin32==303 (from versions: none)
    ERROR: No matching distribution found for pywin32==303

  30. Hey,

    this link https://botbox.dev/discoAI/download/main.zip is broken.
    I cloned the repo, though I can’t see the requirements.txt file

  31. it seems Firefox forces redirection to https that causes the 404, tried with Brave and it works. Thanks again for your reply

  32. Benjamin Hughes

    Thanks for the amazing guide 👌

    I set use_cpu to True and get this error:
    RuntimeError: attn = softmax(attn, dim=-1)
    File “C:\Users\benjamin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\torch\nn\functional.py”, line 1680, in softmax
    ret = input.softmax(dim)
    RuntimeError: “softmax_lastdim_kernel_impl” not implemented for ‘Half’

    Do you have any idea of how to fix this. Im on windows

  33. Thanks for the great guide!
    Actually, I followed each step and everything seems fine.
    Unfortunately, it stops when batching starts 🙁

    “Prepping model…
    Batches: 0%| | 0/1 [00:00<?, ?it/s]
    [1] 7995 killed python3 main.py"

    I am using CPU… I guess this is a memory issue…
    If you have any suggestions it would be great!
    Thanks again!

  34. In the Diffuse step it said RuntimeError. It failed at ” 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’) “, why is that happening?

  35. I met the same problem on colab as eden. Is that because my connection was weak? I used vpn.
    RuntimeError Traceback (most recent call last)

    in ()
    160 print(‘Prepping model…’)
    161 model, diffusion = create_model_and_diffusion(**model_config)
    –> 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’))
    163 model.requires_grad_(False).eval().to(device)
    164 for name, param in model.named_parameters():

    1 frames

    /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
    241 class _open_zipfile_reader(_opener):
    242 def __init__(self, name_or_buffer) -> None:
    –> 243 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
    244
    245

    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

  36. Hi, I’m running v5.2 on Google Colab with default settings. And I got this error:
    —————————————————————————
    FileNotFoundError Traceback (most recent call last)
    in ()
    133 if use_secondary_model:
    134 secondary_model = SecondaryDiffusionImageNet2()
    –> 135 secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
    136 secondary_model.eval().requires_grad_(False).to(device)
    137

    2 frames
    /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name, mode)
    210 class _open_file(_opener):
    211 def __init__(self, name, mode):
    –> 212 super(_open_file, self).__init__(open(name, mode))
    213
    214 def __exit__(self, *args):

    FileNotFoundError: [Errno 2] No such file or directory: ‘/content/drive/MyDrive/AI/Disco_Diffusion/models/secondary_model_imagenet_2.pth’

    It feels like the download link of the .pth file does not work. Can you kindly help me with this? Thank you.

  37. Jaime Jasso

    I’m stuck on execution 17
    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

  38. Hey i’m getting RuntimeError: CUDA out of memory. Tried to allocate 1.88 GiB (GPU 0; 11.00 GiB total capacity; 7.70 GiB already allocated; 0 bytes free; 9.00 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    • It’s running out of VRAM, try a smaller image/fewer models. You may get another different error later, but any CUDA error other than the one that mentions launch blocking means not enough VRAM.

  39. I found some questions when I run
    `secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))`
    and
    `lpips_model = lpips.LPIPS(net=’vgg’).to(device)`

    I’m using RTX3090 and when I execute the codes above, the script just stay running for unlimited time (seemingly not be able to load successfully?)

    I feel confused for this question as the other scripts are successfully passed.

  40. I got error while doing step 2,it shows these:
    512 Model already downloaded, check check_model_SHA if the file is corrupt
    Secondary Model already downloaded, check check_model_SHA if the file is corrupt
    —————————————————————————
    RuntimeError Traceback (most recent call last)
    in ()
    171 secondary_model = SecondaryDiffusionImageNet2()
    172 secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
    –> 173 secondary_model.eval().requires_grad_(False).to(device)
    174
    175 clip_models = []

    3 frames
    /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in to(self, *args, **kwargs)
    905 return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
    906
    –> 907 return self._apply(convert)
    908
    909 def register_backward_hook(

    /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _apply(self, fn)
    576 def _apply(self, fn):
    577 for module in self.children():
    –> 578 module._apply(fn)
    579
    580 def compute_should_use_set_data(tensor, tensor_applied):

    /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _apply(self, fn)
    599 # `with torch.no_grad():`
    600 with torch.no_grad():
    –> 601 param_applied = fn(param)
    602 should_use_set_data = compute_should_use_set_data(param, param_applied)
    603 if should_use_set_data:

    /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in convert(t)
    903 return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None,
    904 non_blocking, memory_format=convert_to_format)
    –> 905 return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
    906
    907 return self._apply(convert)

    RuntimeError: CUDA error: an illegal memory access was encountered
    CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
    For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

  41. ‘model_path’ not defined showing up as of 5/14 3pm PST. Failing on Step 2.

  42. Getting this –

    name ‘lpips’ is not defined
    File “C:\Users\yesim\Documents\DISCO DIFFUSION\main\main.py”, line 1121, in
    lpips_model = lpips.LPIPS(net=’vgg’).to(device)

    any tips ?

  43. Hi there!
    Im having a message error everytime i try to setup DD, its in step 2, diffusion and clip models.

    FileNotFoundError: [Errno 2] No such file or directory: ‘/content/drive/MyDrive/AI/Disco_Diffusion/models/secondary_model_imagenet_2.pth’

    Since that this file cant be installed. I tried everything. check_model_SHA and changing the diffusion model to 256.

    any ideas?

  44. I have this problem: when DD ends his work, the image goes immediately away and the program starts again… how can i stop it at the end? In this way the images are lost before i can even watch them!

  45. DD worked perfectly yesterday. Today suddenly it hardly connects, it is not possible to disconnect because it freezes, it tells me that you cannot do the “check GPU status” because it is not possible to communicate with the NVIDIA Drivers (but I have no NVIDIA cards and I didn’t even have them yesterday when the program was running … plus it tells me that the CODA GPUS are not available. What has changed since yesterday? I have been using the program all day with no problems. The only way to make it work now is to use the CPU, but doing so it takes 20 minutes to complete 1% of the job Thanks for your attention and any help.

    • With only a CPU, it will just take a long time.

      • But why yesterday was it working and today doesn’t? I didn’t change anything, and the pc is the same as yesterday… What happened? And is there anything I can do to change this situation?
        Yea. If you use the cpu only it takes 1 hours to do 3%…impossibile!

  46. I have it up and running, but the output images are just plain black.

  47. Hi,
    First, thank you so much for this entire tool. It is amazing!!

    I am having a little trouble today getting some 404 errors importing and installing dependencies.

    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/imagemagick-6-common_6.9.7.4+dfsg-16ubuntu6.12_all.deb 404 Not Found [IP: 91.189.91.38 80]
    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/libmagickcore-6.q16-3_6.9.7.4+dfsg-16ubuntu6.12_amd64.deb 404 Not Found [IP: 91.189.91.38 80]
    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/libmagickwand-6.q16-3_6.9.7.4+dfsg-16ubuntu6.12_amd64.deb 404 Not Found [IP: 91.189.91.38 80]
    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/imagemagick-6.q16_6.9.7.4+dfsg-16ubuntu6.12_amd64.deb 404 Not Found [IP: 91.189.91.38 80]
    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/imagemagick_6.9.7.4+dfsg-16ubuntu6.12_amd64.deb 404 Not Found [IP: 91.189.91.38 80]
    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/i/imagemagick/libmagickcore-6.q16-3-extra_6.9.7.4+dfsg-16ubuntu6.12_amd64.deb 404 Not Found [IP: 91.189.91.38 80]

  48. “1.3 Install and import dependencies”

    • That’s not a “script,” but whatever script you’re using is designed for ubuntu. I assume this isn’t the base one that I have in my guide, right?

  49. Sorry for the wrong terminology. It has been a LONG time since I have really done anything resembling coding. I am a designer/animator these days and just love this “Disco Diffusion v4.1 [w/ Video Inits, Recovery & DDIM Sharpen].ipynb”

    Maybe I am not even asking for help in the right place. I am sorry. I am just stepping though the steps on Colab.

  50. Hi,I’m getting an error :e:\work\DD\Disco_Diffusion.ipynb Cell 14′ in ()
    135 try:
    –> 136 from infer import InferenceHelper
    137 except:

    ImportError: cannot import name ‘InferenceHelper’ from ‘infer’ (e:\work\DD\myvenv\lib\site-packages\infer\__init__.py)

    I have tried reinstalling infer, but it doesn’t work after several attempts.I’ve been stuck for two days and I haven’t found a solution.

    My version is Disco Diffusion V5.2.

    • I finally solved it, but I have a new problem:
      AssertionError: Torch not compiled with CUDA enabled.

      My CUDA Version is:
      NVIDIA-SMI 512.95 Driver Version: 512.95 CUDA Version: 11.6

      And I Installl from PyTorch

      pip3 install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu113

      But it don’t work.I still trapped in the new problem.

  51. Hi! I’m getting this errors. I don’t code and solved it yesterday without touching the code but can’t remember how.

    Could you hel? Thank you!!

    FileNotFoundError Traceback (most recent call last)
    in ()
    160 print(‘Prepping model…’)
    161 model, diffusion = create_model_and_diffusion(**model_config)
    –> 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt’, map_location=’cpu’))
    163 model.requires_grad_(False).eval().to(device)
    164 for name, param in model.named_parameters():

    2 frames
    /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name, mode)
    210 class _open_file(_opener):
    211 def __init__(self, name, mode):
    –> 212 super(_open_file, self).__init__(open(name, mode))
    213
    214 def __exit__(self, *args):

    FileNotFoundError: [Errno 2] No such file or directory: ‘/content/drive/MyDrive/AI/Disco_Diffusion/models/512x512_diffusion_uncond_finetune_008100.pt’

    • There is some error with file paths, with the file open in VS code, press ctrl+f and type “/content/drive/MyDrive/AI/Disco_diffusion” and it will bring you to that line in the code, replace “/content/drive/MyDrive/AI/Disco_diffusion” with “./” and make sure that you downloaded the models into the model folder.
      If you join our Discord (https://discord.gg/sNd4TNmhxE) we can likely help you better with this.

  52. vaportrail

    Stuck on step 8. Error is below.

    PS C:\Users\Owner\Downloads\disco-diffusion-main> pip3 install -r requirements.txt
    ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirements.txt’

    Also, for step 7, can you clarify what you mean by the “content folder”

    Thanks

    • There should be a folder called content, and you need to find the directory with the requirements.txt file, and cd into it. Then the command will work.

      • vaportrail

        Can you be more specific? I don’t see a folder called content. Is this part of the Disco-diffusion-main folder that I downloaded or is it part of something else?

        • Are you in the folder called main? Sometimes there will be another folder called main inside the first one, go into that. Then you will find a folder called content.

  53. vaportrail

    DISCO-DIFFUSION-MAIN>disco-diffusion-main>docker>main>Dockerfile

    Is the only instance of a folder called “main” I can see.

  54. Can u give me screenshots of the procedure on how to pass the CUDA_LAUNCH_BLOCKING=1. I am not that techy with all this, so is there a certain platform where I have to run this function? In the disco diffusion AI bot generator, it says that, “RuntimeError: CUDA error: an illegal memory access was encountered
    CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
    For debugging consider passing CUDA_LAUNCH_BLOCKING=1.”

  55. Hi! I’m geting this error:
    NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
    I was trying to install CUDA 11.3 but it’s still doesn’t fix a proplem.
    I can’t understand what is the problem. Can you help me?

    • You need to install the nvidia driver.

      • I did it, but it’s not working. May be it’s COLLAB error, because sometimes the code runs a couple of times, but then this error starts to appear. Or do I need some special driver besides the standard nvidia and CUDA?

  56. Ahmed Behiry

    Hello
    In step 11 after typing python3 main.py , I’m getting this error:
    C:\Users\Desktop\main\main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
    if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
    filepath ./content/init_images exists.
    filepath ./content/images_out exists.
    filepath ./content/models exists.
    Traceback (most recent call last):
    File “C:\Users\Desktop\main\main.py”, line 191, in
    import timm
    ModuleNotFoundError: No module named ‘timm’

    I tried this: pip install timm, and it worked fine:
    Successfully installed timm-0.6.7

    but I’m still getting this error..

  57. I’m attempting to install 5.6 and after solving some errors, I’m stumped on InferenceHelper in disco_xform_utils.py

    —————————————————————————
    ImportError Traceback (most recent call last)
    File h:\Projects\#AI Image Gen\DiscoDiffusion\main\disco_xform_utils.py:12, in
    11 try:
    —> 12 from infer import InferenceHelper
    13 except:

    ImportError: cannot import name ‘InferenceHelper’ from ‘infer’ (h:\Projects\#AI Image Gen\DiscoDiffusion\main\venv\lib\site-packages\infer\__init__.py)

    ———-

    Would it be easier to just use google colab and have it run on my local gpu? (RTX 3090)
    Seems like it has a lot of trouble with folders, file names and python versions installed directly to my drive.

    • I haven’t seen this before, I don’t know what inferenceHelper is, hopefully someone else can solve this.

      • I keep having issues where the installer simply can not find things that are right there in the local folder they’re supposed to be in.. Same goes for the AI training script.

        I’m not a Python programmer but I’m thinking if I knew how to point everything to an exact absolute path(including drive letters) it might solve some problems, I have a feeling relative path may be broken for me. There also might be something wrong with my Python installation, because originally I just tried to download it from the Python site, but then VS Code didn’t detect it and installed it again from the Horrible microsoft store.

  58. I use Quadro M4000, just works fine with this setthing. Thank you~

  59. Thank you so much for sharing and helping I really appreciate what you are doing. I deleted my folders from google drive and now I am trying to start fresh. Diffusion and CLIP model settings> will not load the secondary model. It ran all night and secondary model is 85MB and the SHA does not match. Ive tried restarting everything and deleted the model again nothing seems to work. I feel like there is a cache somewhere that needs to be reset since deleting the folders which i now regret doing.

Leave a Reply to Ironclad Cancel

Your email address will not be published.