openai / guided-diffusion

MIT License
6.06k stars 807 forks source link

enumerate errors #13

Open Joeyd348039 opened 2 years ago

Joeyd348039 commented 2 years ago

I seem to keep getting enumerate errors. IndexError: list index out of range

And the code with problems is in this range:

    **for j, sample in enumerate(samples):**
        cur_t -= 1
        if j % 100 == 0 or cur_t == -1:
            print()
            for k, image in enumerate(sample['pred_xstart']):
                filename = f'progress_{i * batch_size + k:1}.png'
                TF.to_pil_image(image.add(1).div(2).clamp(0, 1)).save(filename)
                tqdm.write(f'Batch {i}, step {j}, output {k}:')
                display.display(display.Image(filename))

That first line is usually where the error is highlighted. I'm new to this so is there anywhere I should be looking to see whats wrong?

unixpickle commented 2 years ago

Can you post the entire stack trace / code that you are using to produce this issue?