Skip to content

txt2img training error #10

Description

@mwmw7

Config
image

Data
image

    return func(*args, **kwargs)
  File "/home/toonsquare/PycharmProjects/toonsquare-creamylong-stable-diffusion/ldm/models/diffusion/ddpm.py", line 735, in get_input
    xc = batch[cond_key]
KeyError: 'caption'

I think this is reason

def _sample_generator(self, start, end):
        for idx in range(start, end):
            file_name = self.file_list[idx]
            txt_name = self.txt_list[idx]
            f_ = open(txt_name, 'r')
            txt_ = f_.read()
            f_.close()
            image = cv2.imdecode(np.fromfile(file_name, dtype=np.uint8), 1)
            image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
            image = torch.from_numpy(image) / 255
            yield {"txt": txt_, "image": image}

It seems that this repository and guide might not be ready for out-of-the-box training, right?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions