# How to change transfer learning model for a lot of classes

**URL:** <https://discuss.pytorch.org/t/how-to-change-transfer-learning-model-for-a-lot-of-classes/174921>\
**Category:** vision\
**Created:** [March 15, 2023, 2:48pm UTC](https://discuss.pytorch.org/t/how-to-change-transfer-learning-model-for-a-lot-of-classes/174921 "2023-03-15T14:48:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mahi](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@Mahi](https://discuss.pytorch.org/u/Mahi)\
**Post date:** [March 18, 2023, 4:11pm UTC](https://discuss.pytorch.org/t/how-to-change-transfer-learning-model-for-a-lot-of-classes/174921/4 "2023-03-18T16:11:44Z")

</div>

You can alter the particular layer of pretrained model once it is loaded.

Refer this answer for more information.  
[https://discuss.pytorch.org/t/how-to-delete-layer-in-pretrained-model/17648/6?u=mahi](https://discuss.pytorch.org/t/how-to-delete-layer-in-pretrained-model/17648/6)

And if the accuracy is lower, you can add some layers before the last one and train it few more epochs by freezing the pretrained layers.

Hope it helps!.

---

_[View the full topic](https://discuss.pytorch.org/t/how-to-change-transfer-learning-model-for-a-lot-of-classes/174921)._
