Skip to content

[bug]: NameError: name 'gc' is not defined #2072

@joshistoast

Description

@joshistoast

Is there an existing issue for this?

  • I have searched the existing issues

OS

Linux

GPU

cuda

VRAM

8GB

What happened?

This issue arises when using the high res optimization to generate an image. It successfully makes both passes on the low res and higher res versions of the image, and at the end an error is printed to the console NameError: name 'gc' is not defined and does not reveal the finished image.

Screenshots

No response

Additional context

Traceback (most recent call last):
  File "C:\Users\artis\Documents\invokeai\.venv\lib\site-packages\backend\invoke_ai_web_server.py", line 1125, in generate_images
    self.generate.prompt2image(
  File "C:\Users\artis\Documents\invokeai\.venv\lib\site-packages\ldm\generate.py", line 492, in prompt2image
    results = generator.generate(
  File "C:\Users\artis\Documents\invokeai\.venv\lib\site-packages\ldm\invoke\generator\base.py", line 98, in generate
    image = make_image(x_T)
  File "C:\Users\artis\Documents\invokeai\.venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\artis\Documents\invokeai\.venv\lib\site-packages\ldm\invoke\generator\txt2img2img.py", line 106, in make_image
    gc.collect()
NameError: name 'gc' is not defined

Contact Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions