Hi @ptrblck
The pre-trained model I have is a transformer model and it is an ordered dictionary. Now I want to extract the embeddings from the MLP which is the penultimate layer before the loss functions. I have to extract the transformer embeddings from this MLP layer for my test images. I tried the hook functions, since pre-trained model is an ordered dictionary  with key-value pairs it is showing error as “Tensor objects cannot have forward hooks”. How can I access the MLP layer to extract the embeddings. Here is the github link for the pre-trained model GitHub - zhongyy/Face-Transformer: Face Transformer for Recognition 1.