# Can I use CUDA with Trainer.train?

**URL:** <https://discuss.huggingface.co/t/can-i-use-cuda-with-trainer-train/17566>\
**Category:** Beginners\
**Created:** [May 5, 2022, 3:19pm UTC](https://discuss.huggingface.co/t/can-i-use-cuda-with-trainer-train/17566 "2022-05-05T15:19:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [May 6, 2022, 12:04pm UTC](https://discuss.huggingface.co/t/can-i-use-cuda-with-trainer-train/17566/2 "2022-05-06T12:04:52Z")

</div>

Hi! The first error is a known bug (see [Sending a Dataset or DatasetDict to a GPU](https://discuss.huggingface.co/t/sending-a-dataset-or-datasetdict-to-a-gpu/17208)). Can you update your installation of transformers with `pip install -U transformers` and rerun the first snippet?

---

_[View the full topic](https://discuss.huggingface.co/t/can-i-use-cuda-with-trainer-train/17566)._
