# Transformers module - parameter count and size

**URL:** <https://discuss.huggingface.co/t/transformers-module-parameter-count-and-size/68903>\
**Category:** 🤗Transformers\
**Created:** [January 12, 2024, 8:46am UTC](https://discuss.huggingface.co/t/transformers-module-parameter-count-and-size/68903 "2024-01-12T08:46:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![infinte132](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@infinte132](https://discuss.huggingface.co/u/infinte132)\
**Post date:** [January 12, 2024, 8:46am UTC](https://discuss.huggingface.co/t/transformers-module-parameter-count-and-size/68903/1 "2024-01-12T08:46:17Z")

</div>

Normally, the model size / parameter count can be calculated like

`pytorch_total_params = sum(p.numel() for p in model.parameters())`

> **[Finding model size](https://discuss.pytorch.org/t/finding-model-size/130275)**
>
> Hi, I am curious about calculating model size (MB) for NN in pytorch. Is it equivalent to the size of the file from torch.save(model.state\_dict(),‘example.pth’)? Please refer to the image below from PointNet++

But when we use transformers module, the normal ways didn’t work

```auto
from transformers import Wav2Vec2Processor
processor = Wav2Vec2Processor.from_pretrained("facebook/hubert-xlarge-ls960-ft")
# processor.parameters() -> error (has no attribute parameters)
# Wav2Vec2Processor.parameters() -> error (has no attribute parameters)
# Wav2Vec2Processor.feature_extractor.parameters() -> error (has no attribute parameters) 

```

Is there any way to know the model size / paramter count of transformers module?
