# How to get intermediate features from HF pretrained model?

**URL:** <https://discuss.huggingface.co/t/how-to-get-intermediate-features-from-hf-pretrained-model/42418>\
**Category:** Intermediate\
**Created:** [June 7, 2023, 1:46pm UTC](https://discuss.huggingface.co/t/how-to-get-intermediate-features-from-hf-pretrained-model/42418 "2023-06-07T13:46:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![u-tokyo](https://avatars.discourse-cdn.com/v4/letter/u/848f3c/32.png) [@u-tokyo](https://discuss.huggingface.co/u/u-tokyo)\
**Post date:** [June 7, 2023, 1:46pm UTC](https://discuss.huggingface.co/t/how-to-get-intermediate-features-from-hf-pretrained-model/42418/1 "2023-06-07T13:46:08Z")

</div>

I am trying to use the [Wav2Vec2 conformer](https://huggingface.co/transformers/v4.4.2/model_doc/wav2vec2.html#wav2vec2model) and instead of final layer outputs, I want to index the weights after 6th MultiHeadAttention Layer, how do I do that?
