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

**URL:** <https://discuss.huggingface.co/t/attributeerror-datasetdict-object-has-no-attribute-to/26892>\
**Category:** 🤗Datasets\
**Created:** [November 28, 2022, 8:54pm UTC](https://discuss.huggingface.co/t/attributeerror-datasetdict-object-has-no-attribute-to/26892 "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](https://discuss.huggingface.co/u/dluzano)\
**Post date:** [November 28, 2022, 8:54pm UTC](https://discuss.huggingface.co/t/attributeerror-datasetdict-object-has-no-attribute-to/26892/1 "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](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [November 29, 2022, 2:22pm UTC](https://discuss.huggingface.co/t/attributeerror-datasetdict-object-has-no-attribute-to/26892/2 "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.
