# Datasets.map is not consistent with IterableDataset?

**URL:** <https://discuss.huggingface.co/t/datasets-map-is-not-consistent-with-iterabledataset/154912>\
**Category:** 🤗Datasets\
**Created:** [May 13, 2025, 3:00pm UTC](https://discuss.huggingface.co/t/datasets-map-is-not-consistent-with-iterabledataset/154912 "2025-05-13T15:00:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [May 14, 2025, 7:41am UTC](https://discuss.huggingface.co/t/datasets-map-is-not-consistent-with-iterabledataset/154912/2 "2025-05-14T07:41:41Z")

</div>

I think that’s probably normal…  
[https://stackoverflow.com/questions/74251282/huggingface-datasets-storing-and-loading-image-data](https://stackoverflow.com/questions/74251282/huggingface-datasets-storing-and-loading-image-data)

> [@Turn of automatic Pil image generation in load\_dataset](https://discuss.huggingface.co/t/turn-of-automatic-pil-image-generation-in-load-dataset/103222):
>
> when loading a dataset, I have the following arrow format - label: int, image: struct\<bytes:binary, path:string\>. when using load\_dataset() method, the image is automatically converted to Pil image format, and the path is lost. is there a way to avoid that behavior? In my example - dataset = load\_dataset("chronopt-research/cropped-vggface2-224") for i in range(0, len(dataset['train']), batch\_size): batch = dataset['train'][i:i + batch\_size] images = batch['image'] # Original 224x224 i…

> [@How to return PIL.Image from dataset generator?](https://discuss.huggingface.co/t/how-to-return-pil-image-from-dataset-generator/31160):
>
> I have a custom GeneratorBasedBuilder subclass that I’m trying to get running. It seems like I’m almost there, but my trainer is failing with a type error when trying to access a generated sample—to be more specific, I’m working with the train\_text\_to\_image.py script and it’s failing at the preprocess\_train(examples) function… From what I understand, this is because the actual data is a PIL.Image, but my generator’s features dict lists the features as "image": datasets.Value("string"), which is…

---

_[View the full topic](https://discuss.huggingface.co/t/datasets-map-is-not-consistent-with-iterabledataset/154912)._
