Skip to content

Conversation

@karry-z
Copy link

@karry-z karry-z commented Jul 20, 2025

Description

Fixes a KeyError in eval/measure_vram.py where the code tries to access batch["image"],
but the correct key is batch["images"].

Specifically, when running eval/measure_vram.py, I encountered the following error:

KeyError: 'image'
File ".../measure_vram.py", line 130, in measure_vram
images = batch["image"].to(device)

After checking train.py, I noticed that similar code has already been updated to use:

batch["images"]

This suggests that measure_vram.py may not have been updated accordingly.

Related Issue

No issue submitted for this simple fix.

Testing

  • Ran python eval/measure_vram.py and confirmed this error is resolved.
  • Further testing revealed other unrelated issues, which will be reported separately.

Notes

This is a straightforward fix to unblock running the evaluation script.

Corrects a KeyError caused by accessing batch["image"] instead of batch["images"],
consistent with the batch structure used in train.py.
break

images = batch["image"].to(device)
images = batch["images"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we still need the .to(device) function

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants