Convering tf to torch: How to set custom embedding_size when using load_tf_weights_in_bert?
I'm trying to convert a bert-tiny model into torch version and I am using the "load_tf_weights_in_bert" scripts from transformers.
And when I executed the function and fed the right checkpoints and configs, the scripts reported:

ValueError: Pointer shape torch.Size([312]) and array shape (128,) mismatched

After debugging the code I realized that transformers uses "hidden_size" to initialize the embedding layer, which is: 
![image](https://user-images.githubusercontent.com/3974928/147655692-040902d6-02b7-4e71-b677-fae1b354de02.png)

However, in the bert model config it uses a different "embedding_size" to indicate the hidden size of the embedding layer, which is different from "hidden_size config", like the following:

![image](https://user-images.githubusercontent.com/3974928/147655811-bfceeba4-9005-43ab-ad3b-5b67bc602a3a.png)

Since the source code uses the config.hidden_size to initialize the embedding layer, is there any way I can pass a different number to initialize it? So that I can successfully convert the tf model to torch. Thanks!
Hi,

In that case, I would fork the library, and create a new branch that adjusts the word embeddings to be:

`self.word_embeddings = nn.Embedding(config.vocab_size, config.embedding_size, padding_idx=config.pad_token_id)`

If you then convert the checkpoint from your new branch, it will work.<|||||>Thanks. Will it be considered to add this feature into the main branch? Or shall I create a MR for it?<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.<|||||>I don't think we are going to include this in the main branch. Therefore, closing this issue.

If you have comments, feel free to reopen.