# Error from CUDA on audio classification

**URL:** <https://discuss.huggingface.co/t/error-from-cuda-on-audio-classification/33234>\
**Category:** Beginners\
**Created:** [March 7, 2023, 10:37am UTC](https://discuss.huggingface.co/t/error-from-cuda-on-audio-classification/33234 "2023-03-07T10:37:07Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![xavialex](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/xavialex/32/33920_2.png) [@xavialex](https://discuss.huggingface.co/u/xavialex)\
**Post date:** [August 19, 2023, 7:21pm UTC](https://discuss.huggingface.co/t/error-from-cuda-on-audio-classification/33234/3 "2023-08-19T19:21:42Z")

</div>

Hi @dmoti:

I’ve ran into the same issue in a similar environment (W11). In my case, even switching to CPU (setting the TrainingArguments parameter no\_cuda to True) resulted in an error like [this](https://discuss.huggingface.co/t/runtimeerror-when-training-starts-expected-scalar-type-long-but-found-int/16920). In the Trainer, using the datasets with\_format(‘torch’) made it work with and without CUDA enabled. Example below:

```python
trainer = Trainer(
    model,
    training_args,
    train_dataset=dataset_encoded["train"].with_format("torch"),
    eval_dataset=dataset_encoded["test"].with_format("torch"),
    tokenizer=feature_extractor,
    compute_metrics=compute_metrics,
)

```

Hope this helps.

---

_[View the full topic](https://discuss.huggingface.co/t/error-from-cuda-on-audio-classification/33234)._
