timothybrooks / instruct-pix2pix

Other
6.4k stars 539 forks source link

Error in generate_img_dataset.py #135

Open bimsarapathiraja opened 2 months ago

bimsarapathiraja commented 2 months ago

I wanted to create my own dataset and followed Creating your own dataset section. I went straight to step 2 since I wanted to use your captions and edit instructions. But when I ran python dataset_creation/generate_img_dataset.py --out_dir data/instruct-pix2pix-dataset-000 --prompts_file path/to/generated_prompts.jsonl I get this error -

Prompts:   0%|          | 0/452148 [00:00<?, ?it/s]
Prompts:   0%|          | 0/452148 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "dataset_creation/generate_img_dataset.py", line 315, in <module>
    main()
  File "dataset_creation/generate_img_dataset.py", line 250, in main
    cond = model.get_learned_conditioning([prompt["caption"], prompt["output"]])
KeyError: 'caption'

What can I do here?

alwinkai commented 1 month ago

If you are using gpt-generated-prompts.jsonl, replace prompt["caption"] with prompt["input"].