# ValueError: Expected input batch\_size (4096) to match target batch\_size (8)

**URL:** <https://discuss.huggingface.co/t/valueerror-expected-input-batch-size-4096-to-match-target-batch-size-8/14982>\
**Category:** Beginners\
**Created:** [February 21, 2022, 5:08pm UTC](https://discuss.huggingface.co/t/valueerror-expected-input-batch-size-4096-to-match-target-batch-size-8/14982 "2022-02-21T17:08:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mdroth](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mdroth/32/29308_2.png) [@mdroth](https://discuss.huggingface.co/u/mdroth)\
**Post date:** [April 2, 2023, 12:13am UTC](https://discuss.huggingface.co/t/valueerror-expected-input-batch-size-4096-to-match-target-batch-size-8/14982/4 "2023-04-02T00:13:16Z")

</div>

I have had the same problem and managed to solve it as shown [here](https://discuss.huggingface.co/t/reshaping-logits-when-using-trainer/18214/2). As @ahmedbr points out, more details – in particular what task you train for – are required to solve this.

---

_[View the full topic](https://discuss.huggingface.co/t/valueerror-expected-input-batch-size-4096-to-match-target-batch-size-8/14982)._
