# About the vision category

**URL:** <https://discuss.pytorch.org/t/about-the-vision-category/22>\
**Category:** vision\
**Created:** [January 14, 2017, 4:57pm UTC](https://discuss.pytorch.org/t/about-the-vision-category/22 "2017-01-14T16:57:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [January 14, 2017, 4:57pm UTC](https://discuss.pytorch.org/t/about-the-vision-category/22/1 "2017-01-14T16:57:30Z")

</div>

Topics related to either pytorch/vision or vision research related topics

---

<div class="post-metadata">

**Author:** ![bunnisiva](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/bunnisiva/32/8594_2.png) [@bunnisiva](https://discuss.pytorch.org/u/bunnisiva)\
**Post date:** [January 20, 2019, 1:11am UTC](https://discuss.pytorch.org/t/about-the-vision-category/22/3 "2019-01-20T01:11:07Z")

</div>

hallo, I am new to pytorch, but I am enjoying this framework. I am having diffeculty in figuring out this message.can anyone help please !!  
RuntimeError: The size of tensor a (10) must match the size of tensor b (32) at non-singleton dimension 0  
I did a bit of debugging and I found that there is a collapse of labels happening in labels tensors  
[[[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000],  
[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000],  
[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000],  
…,  
[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000],  
[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000],  
[-1.0000, -1.0000, -1.0000, …, -1.0000, -1.0000, -1.0000]]]]) tensor([9, 2, 1, 1, 6, 1, 4, 6, 5, 7, 4, 5, 7, 3, 4, 1, 2, 4, 8, 0, 2, 5, 7, 9,  
1, 4, 6, 0, 9, 3, 8, 8])

I created my model from scratch . I tried with batch\_size 32 , it threw me this error. I tried with batch\_size 1 , I got 320% accuracy (something wrong !). The error went away. so there is some dimensional mismatch some where, I am lost! thanks a million !!! for your help and advise

---

<div class="post-metadata">

**Author:** ![JoBot\_CoBot](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jobot_cobot/32/19325_2.png) [@JoBot\_CoBot](https://discuss.pytorch.org/u/JoBot_CoBot)\
**Post date:** [January 3, 2020, 8:10am UTC](https://discuss.pytorch.org/t/about-the-vision-category/22/4 "2020-01-03T08:10:01Z")

</div>

can we see your Model ?

---

<div class="post-metadata">

**Author:** ![joekohler](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/joekohler/32/65655_2.png) [@joekohler](https://discuss.pytorch.org/u/joekohler)\
**Post date:** [November 21, 2023, 3:11pm UTC](https://discuss.pytorch.org/t/about-the-vision-category/22/5 "2023-11-21T15:11:31Z")

</div>

Hi, if you jumped in too fast as far as model building goes, don’t be discouraged. A few months ago, I tried building a model without reading the documentation entirely. Now that I’ve ingested a lot of the documentation, I’m feeling a lot more confident about building models in PyTorch, and to be honest… that seems like the least of what i will be able to do soon, in PyTorch

So my best advice is if you need help, is to read the documentation, and you’ll be able to really receive the fruits from your reading soon!

---

<div class="post-metadata">

**Author:** ![shalom\_p](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shalom_p/32/65249_2.png) [@shalom\_p](https://discuss.pytorch.org/u/shalom_p)\
**Post date:** [November 28, 2023, 7:11am UTC](https://discuss.pytorch.org/t/about-the-vision-category/22/6 "2023-11-28T07:11:20Z")

</div>

from what is available I can see that your model output has different number of dimensions from your labels… here is an example for you to understand their structure better.

```auto
import torch
model_output = torch.randn((32,10))
print(model_output.size())#this will be the model outputs size

label = torch.randn((10))
print(label.size())#this will be the label size

```

assume that 32 is the batch size so your labels also should have the same dimension in order to get the results you are looking for. when you are creating or loading your data make sure that you have the correct corresponding label along with it.  
please let me know if you need further assistance.
