Converting Tensorflow checkpoint to Pytorch not work for TF models downloaded using TFAutoModel.from_pretrained()
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, make sure to tag your
     question with the right deep learning framework as well as the
     huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     -->

## Details
<!-- Description of your issue -->
I took a try of converting tf checkpoint to pytorch and it works well on the model that in the links on your [page](https://huggingface.co/transformers/converting_tensorflow_models.html)
However, the conversion seems not working with models(bert, albert..) that downloaded using TFAutoModel.from_pretrained()
I am wondering if I miss anything or those models are not currently supported?

Thanks
<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:
Could you provide an example code that didn't work?<|||||>Providing the example for repo as below(e.g. let's try bert):
`from transformers import AutoConfig, TFAutoModel, BertForPreTraining, load_tf_weights_in_bert`
`model_name = "bert-base-uncased"`
`config = AutoConfig.from_pretrained(model_name)`
`tf_model = TFAutoModel.from_pretrained(model_name, config)#get the tf model using TFAutoModel`
`tf_model.save_weights("./bert")#save tf model to ckpt`
`pt_model = BertForPreTraining(config)#init pt model`
`load_tf_weights_in_bert(pt_model, config, "./")#convert tf ckpt to pt model`<|||||>You should use `save_pretrained` and `from_pretrained` to do the conversion:

```py
tf_model.save_pretrained("./bert")
pt_model = BertForPreTraining.from_pretrained("./bert", from_tf=True)
```<|||||>Yes, the conversion above works for me. But it seems to me that load_tf_weights_in_bert() works only with limited Bert model if I want to convert tensorflow checkpoint to a pytorch model.<|||||>The `load_tf_weights_in_bert` method is meant to be used to convert BERT models from the original implementation (google-research/bert), not to do the conversion between our architectures in PyTorch <>  our architectures in TensorFlow.

Closing as the conversion shown worked!<|||||>Thanks! @LysandreJik 