convert gpt2 from tensorflow to pytorch
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers`  = 4.5.1
- PyTorch version (GPU?) = = 1.8.1+cu101

command :
!python3 /content/transformers/src/transformers/models/gpt2/convert_gpt2_original_tf_checkpoint_to_pytorch.py \
--gpt2_checkpoint_path=/content/drive/MyDrive/tensorflowCheckpoints/model.ckpt-50000 \
--pytorch_dump_folder_path=/content/drive/MyDrive/convertpyorch/torch_model-500gpt2.bin \
--gpt2_config_file=/content/drive/MyDrive/tensorflowCheckpoints/config2.json 

Error :
Traceback (most recent call last):
  File "/content/transformers/src/transformers/models/gpt2/convert_gpt2_original_tf_checkpoint_to_pytorch.py", line 68, in <module>
    convert_gpt2_checkpoint_to_pytorch(args.gpt2_checkpoint_path, args.gpt2_config_file, args.pytorch_dump_folder_path)
  File "/content/transformers/src/transformers/models/gpt2/convert_gpt2_original_tf_checkpoint_to_pytorch.py", line 39, in convert_gpt2_checkpoint_to_pytorch
    load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path)
  File "/usr/local/lib/python3.7/dist-packages/transformers/models/gpt2/modeling_gpt2.py", line 109, in load_tf_weights_in_gpt2
    pointer = getattr(pointer, scope_names[0])
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 948, in __getattr__
    type(self).__name__, name))
AttributeError: 'GPT2Model' object has no attribute '_step'


Hi @7AM7 

I think this is because there is `_step` in TF checkpoint, which should be ignored when loading the weights.

for this you should write your own conversion script. You could take and modify this function
https://github.com/huggingface/transformers/blob/30f065890e77f2917895b175b9a1df503b89e202/src/transformers/models/gpt2/modeling_gpt2.py#L68

adding some check like this here would solve this
```python
for name, shape in init_vars:
        if "_step" not in name name:
```
<|||||>i modified this function def load_tf_weights_in_gpt2 and ignored "_step" Like if name!="_step" or  if "_step" not in name And still same error

<|||||>in that case, you could check what extra variables are there in the `names` and then remove those from `names` and `arrays`. <|||||>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.