# Using MS COCO 2017 dataset for FL simulation

**URL:** <https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357>\
**Category:** Flower Help - Intermediate\
**Tags:** datasets\
**Created:** [October 21, 2024, 3:24pm UTC](https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357 "2024-10-21T15:24:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanrubak](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@johanrubak](https://discuss.flower.ai/u/johanrubak)\
**Post date:** [October 21, 2024, 3:24pm UTC](https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357/1 "2024-10-21T15:24:44Z")

</div>

Hi  
Does someone know if it is possible to load the MSCOCO 2017 dataset with the FederatedDataset class and partition it correctly? I have struggled to do so, since pytorch expect another format than the coco format. Therefore i was wondering if it possible to load a custom pytorch datasetclass created myself in the FederatedDataset, instead of using the string path of it from huggingface?

Appreciate any help!

//Johan

---

<div class="post-metadata">

**Author:** ![chongshenng](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/chongshenng/32/153_2.png) [@chongshenng](https://discuss.flower.ai/u/chongshenng)\
**Post date:** [October 23, 2024, 7:09am UTC](https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357/2 "2024-10-23T07:09:42Z")

</div>

Hello @johanrubak, I haven’t experienced loading MSCOCO from HuggingFace before. But you can create a `FederatedDataset` from your own local images or in-memory data. I think there’s potentially one conversion step to convert PyTorch Dataset to HuggingFace’s Dataset. After that, you can create the `FederatedDataset` from the `Dataset`.

Here’s the link to the Flower Datasets page: [Use with Local Data - Flower Datasets 0.4.0](https://flower.ai/docs/datasets/how-to-use-with-local-data.html).

---

<div class="post-metadata">

**Author:** ![johanrubak](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@johanrubak](https://discuss.flower.ai/u/johanrubak)\
**Post date:** [October 28, 2024, 8:27pm UTC](https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357/3 "2024-10-28T20:27:06Z")

</div>

Thanks a lot, figured a way to load data in a manual way into a huggingface dataset, which is used for partitioning

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/flower/original/1X/bc7fe36843c391cbd0b4e8b6f48275961d356abc.png) [@system](https://discuss.flower.ai/u/system)\
**Post date:** [November 4, 2024, 8:27pm UTC](https://discuss.flower.ai/t/using-ms-coco-2017-dataset-for-fl-simulation/357/4 "2024-11-04T20:27:50Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
