# AttributeError: 'DatasetDict' object has no attribute 'to'

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattributeerror-datasetdict-object-has-no-attribute-to%2F26892%3E%5C
**Category:** 🤗Datasets\
**Created:** [November 28, 2022, 8:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattributeerror-datasetdict-object-has-no-attribute-to%2F26892 "2022-11-28T20:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dluzano](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dluzano/32/12774_2.png) [@dluzano](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdluzano)%5C
**Post date:** [November 28, 2022, 8:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattributeerror-datasetdict-object-has-no-attribute-to%2F26892%2F1 "2022-11-28T20:54:45Z")

</div>

![Screenshot_20221128_024041](https://us1.discourse-cdn.com/hellohellohello/original/2X/3/39af991ae751cc9171dd20986e50c895007d4f18.png)  
Any suggestions about fixing this?

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [November 29, 2022, 2:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattributeerror-datasetdict-object-has-no-attribute-to%2F26892%2F2 "2022-11-29T14:22:55Z")

</div>

You have passed a dataset to the `model` key in the `Trainer`. Try passing a model and the error should disappear.
