from transformers import RobertaTokenizer, TFRobertaModel
import tensorflow as tf
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
model = TFRobertaModel.from_pretrained("roberta-base")
I want a detailed layer summary of this HuggingFace TFRobertaModel() so that I can visualize shapes, layers and customize if needed. However, when I did:
model.summary(), it just shows everything in a single layer. I tried digging into it's different attributes, but not able to get a detailed layer summary. Is it possible to do so?
Model: "tf_roberta_model_2"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
roberta (TFRobertaMainLayer) multiple 124645632
=================================================================
Total params: 124,645,632
Trainable params: 124,645,632
Non-trainable params: 0
_________________________________________________________________
Also, there is a related question in HuggingFace forum which hasn't been answered yet.