text: 
  
  TITLE
  [Error: PyTorch to tf]convert_pytorch_checkpoint_to_tf2: AttributeError: bert.pooler.dense.weight not found in PyTorch model
  
  COMMENTS
  8
  
  REACTIONS
  +1: 0
  -1: 0
  laugh: 0
  hooray: 0
  heart: 0
  rocket: 0
  eyes: 0
  
  BODY
  ## 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` version: 3.5.1
  - Platform: Linux-5.4.0-1029-gcp-x86_64-with-glibc2.10
  - Python version: 3.8.5
  - PyTorch version (GPU?): 1.7.0 (False)
  - Tensorflow version (GPU?): 2.3.1 (False)
  - Using GPU in script?: no
  - Using distributed or parallel set-up in script?: no
  
  ### Who can help
  
  I think:
   @patrickvonplaten @LysandreJik @VictorSanh
  
  Anyone is welcome!
  
  <!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
   If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
   Please tag fewer than 3 people.
   
   albert, bert, GPT2, XLM: @LysandreJik 
   tokenizers: @mfuntowicz
   Trainer: @sgugger
   Speed and Memory Benchmarks: @patrickvonplaten
   Model Cards: @julien-c
   TextGeneration: @TevenLeScao 
   examples/distillation: @VictorSanh
   nlp datasets: [different repo](https://github.com/huggingface/nlp)
   rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
   Text Generation: @patrickvonplaten @TevenLeScao
   Blenderbot: @patrickvonplaten
   Bart: @patrickvonplaten
   Marian: @patrickvonplaten
   Pegasus: @patrickvonplaten
   mBART: @patrickvonplaten
   T5: @patrickvonplaten
   Longformer/Reformer: @patrickvonplaten
   TransfoXL/XLNet: @TevenLeScao
   RAG: @patrickvonplaten, @lhoestq
   FSMT: @stas00
   examples/seq2seq: @patil-suraj
   examples/bert-loses-patience: @JetRunner
   tensorflow: @jplu
   examples/token-classification: @stefan-it
   documentation: @sgugger
   -->
  
  ## Information
  
  Trying to convert my pytorch checkpoint to tf using the below code:
  
  ```python
  from transformers import convert_pytorch_checkpoint_to_tf2
  convert_pytorch_checkpoint_to_tf2.convert_pt_checkpoint_to_tf(
      model_type = "bert", 
      pytorch_checkpoint_path="model/pytorch_model.bin", 
      config_file="model/config.json", 
      tf_dump_path="TFmodel", 
      compare_with_pt_model=False, 
      use_cached_models=False
  )
  ```
  
  my model folder has a tiny bert trained using HuggingFace: contents of `model` folder are: 
  `checkpoint-500            special_tokens_map.json
  config.json               tokenizer_config.json
  eval_results_mlm_wwm.txt  training_args.bin
  pytorch_model.bin         vocab.txt`
  
  ## To reproduce
  
  Error:
  
  ```
  Loading PyTorch weights from /home/3551351/bert-mlm/model/pytorch_model.bin
  PyTorch checkpoint contains 8,354,548 parameters
  Traceback (most recent call last):
    File "pt2tf.py", line 7, in <module>
      convert_pytorch_checkpoint_to_tf2.convert_pt_checkpoint_to_tf(
    File "/home/3551351/.conda/envs/kuldeepVenv/lib/python3.8/site-packages/transformers/convert_pytorch_checkpoint_to_tf2.py", line 283, in convert_pt_checkpoint_to_tf
      tf_model = load_pytorch_checkpoint_in_tf2_model(tf_model, pytorch_checkpoint_path)
    File "/home/3551351/.conda/envs/kuldeepVenv/lib/python3.8/site-packages/transformers/modeling_tf_pytorch_utils.py", line 96, in load_pytorch_checkpoint_in_tf2_model
      return load_pytorch_weights_in_tf2_model(
    File "/home/3551351/.conda/envs/kuldeepVenv/lib/python3.8/site-packages/transformers/modeling_tf_pytorch_utils.py", line 172, in load_pytorch_weights_in_tf2_model
      raise AttributeError("{} not found in PyTorch model".format(name))
  AttributeError: bert.pooler.dense.weight not found in PyTorch model
  ```
  
  <!-- If you have code snippets, error messages, stack traces please provide them here as well.
       Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
       Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->
  
  ## Expected behavior
  
  <!-- A clear and concise description of what you would expect to happen. -->
  