# Advice on training a ViT model with PyTorch

**URL:** <https://dlai.staged-by-discourse.com/t/advice-on-training-a-vit-model-with-pytorch/573726>\
**Category:** AI Discussions\
**Tags:** ai-discussions\
**Created:** [February 18, 2024, 1:55pm UTC](https://dlai.staged-by-discourse.com/t/advice-on-training-a-vit-model-with-pytorch/573726 "2024-02-18T13:55:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishra108](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mishra108](https://dlai.staged-by-discourse.com/u/mishra108)\
**Post date:** [February 18, 2024, 1:55pm UTC](https://dlai.staged-by-discourse.com/t/advice-on-training-a-vit-model-with-pytorch/573726/1 "2024-02-18T13:55:20Z")

</div>

Hey there 👋,  
I recently implemented a ViT model with the help of PyTorch, I thought of performing a simple classification task on it, so I trained the model on a Leaf Disease classification dataset.

After 60 epochs the accuracy only increased to 68%, is this behavior normal, also accuracy doesn’t increase after further epochs. It kind of bounces around 68, I know the ViTs are challenging to train but shouldn’t the accuracy improve at some point?

you can check the uploaded kaggle notebook, I’ve trained the model using pytorch.

Can you tell me what I’m doing wrong, or what I should be doing?  
[vit-with-pytorch.ipynb](https://dlai.staged-by-discourse.com/uploads/short-url/k0sFPc94xma7spF3Hlq1b2Cus1V.ipynb) (59.5 KB)

---

<div class="post-metadata">

**Author:** ![Mosaab\_EL\_Bouamrani](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@Mosaab\_EL\_Bouamrani](https://dlai.staged-by-discourse.com/u/Mosaab_EL_Bouamrani)\
**Post date:** [July 8, 2024, 6:51pm UTC](https://dlai.staged-by-discourse.com/t/advice-on-training-a-vit-model-with-pytorch/573726/2 "2024-07-08T18:51:09Z")

</div>

Hi  
ViT architecture needs allot of data its not like CNN.  
so I think you need more data.
