Skip to content

Fix dataset map multiprocessing and PIL image byte loading - #1

Open
Vedant-K1 wants to merge 1 commit into
johnlockejrr:mainfrom
Vedant-K1:fix-chandra-training-bugs
Open

Fix dataset map multiprocessing and PIL image byte loading#1
Vedant-K1 wants to merge 1 commit into
johnlockejrr:mainfrom
Vedant-K1:fix-chandra-training-bugs

Conversation

@Vedant-K1

Copy link
Copy Markdown

I was running the fine-tuning script and hit a couple of roadblocks... specifically running completely out of system RAM, and the inference test crashing on certain datasets. I've pushed a few fixes for this.

  1. RAM OOM during dataset preparation
    When running map() on the datasets, it was hoarding memory and eventually crashing my setup.
    Fix: I added num_proc to speed things up with multiprocessing, but more importantly, I added writer_batch_size=75. This forces the datasets library to flush to disk regularly, which keeps the system RAM usage under control.

  2. Inference test crashing on raw byte images
    If a HuggingFace dataset returns images as raw byte dicts instead of PIL Images, the pre/post-training inference test fails because the processor expects a PIL Image.
    Fix: Added a quick check to convert raw byte streams into RGB PIL Images using io.BytesIO.

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.

1 participant