# AttributeError: type object 'Dataset' has no attribute 'from\_generator'

**URL:** <https://discuss.huggingface.co/t/attributeerror-type-object-dataset-has-no-attribute-from-generator/84199>\
**Category:** Beginners\
**Created:** [April 28, 2024, 4:43pm UTC](https://discuss.huggingface.co/t/attributeerror-type-object-dataset-has-no-attribute-from-generator/84199 "2024-04-28T16:43:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![t2chiang](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@t2chiang](https://discuss.huggingface.co/u/t2chiang)\
**Post date:** [April 28, 2024, 4:43pm UTC](https://discuss.huggingface.co/t/attributeerror-type-object-dataset-has-no-attribute-from-generator/84199/1 "2024-04-28T16:43:11Z")

</div>

Hi, I just encounter this problem when I want to use datasets package in python. My datasets version is now 2.1.0, and I got the error like the title:

```auto
AttributeError: type object 'Dataset' has no attribute 'from_generator'

```

My code is like this:

```auto
ds = Dataset.from_generator(resampleGen)

```

Thank you.
