NielsRogge / Transformers-Tutorials

This repository contains demos I made with the Transformers library by HuggingFace.
MIT License
9.54k stars 1.45k forks source link

trying to access VisionEncoderDecoderModel DONUT encoder intermediate layers #448

Open AbdulDD opened 4 months ago

AbdulDD commented 4 months ago

Hi there, I have successfully fine-tuned DONUT on my custom dataset for Key-Information extraction (KIE). I have also printed (accessed) last_hidden_state of encoder. Now encoder has 4 layers (model.encoder.num_layers) and I want to access Layer 1 or 2 hidden state. how can I do that?