# Error ValueError: too many values to unpack (expected 2) in model training

**URL:** <https://discuss.huggingface.co/t/error-valueerror-too-many-values-to-unpack-expected-2-in-model-training/116453>\
**Category:** 🤗Transformers\
**Created:** [November 9, 2024, 12:22am UTC](https://discuss.huggingface.co/t/error-valueerror-too-many-values-to-unpack-expected-2-in-model-training/116453 "2024-11-09T00:22:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [November 9, 2024, 1:46am UTC](https://discuss.huggingface.co/t/error-valueerror-too-many-values-to-unpack-expected-2-in-model-training/116453/2 "2024-11-09T01:46:45Z")

</div>

Maybe this?

> [@Batch\_size, seq\_length = input\_shape ValueError: too many values to unpack (expected 2) Transformer Sentence Similarity Classification](https://discuss.huggingface.co/t/batch-size-seq-length-input-shape-valueerror-too-many-values-to-unpack-expected-2-transformer-sentence-similarity-classification/76245):
>
> I encountering a problem when doing Sentence Similarity Classification Task Using Transformer. It happens when I was about to train my model, I load and process my dataset in this way, and this is what the training dataset element shape looks like: but when I train the model, it says: ValueError: Caught ValueError in replica 0 on device 0. Original Traceback (most recent call last): File “/home/fanshaoqi/anaconda3/envs/tf2/lib/python3.10/site-packages/torch/nn/parallel/parallel\_ap…

---

_[View the full topic](https://discuss.huggingface.co/t/error-valueerror-too-many-values-to-unpack-expected-2-in-model-training/116453)._
