Error loading finetuned bert model AttributeError: 'NoneType' object has no attribute 'endswith'
# ❓ 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 Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. 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 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->

## Details
<!--  -->
Unable to load finetuned bert model for language modeling task using run_language_modeling.py script
<!---->
I used the following code to load a fine-tuned model saved on my disk:
`BertForMaskedLM.from_pretrained('outputs/pytorch_model.bin', config=config, from_tf=True).` however I am getting the following error:
Traceback (most recent call last):
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_vars.py", line 342, in evaluateExpression
    compiled = compile(expression, '<string>', 'eval')
  File "<string>", line 1
    from transformers import WEIGHTS_NAME, BertForMaskedLM
       ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_comm.py", line 1071, in doIt
    result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_vars.py", line 344, in evaluateExpression
    Exec(expression, updated_globals, frame.f_locals)
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 2, in <module>
  File "/home/mahdi/anaconda3/envs/py36/lib/python3.6/site-packages/transformers/modeling_utils.py", line 482, in from_pretrained
    if resolved_archive_file.endswith(".index"):
AttributeError: 'NoneType' object has no attribute 'endswith' 

Transformers version:2.5.1
Pytorch version: 1.3.0
**A link to original question on Stack Overflow**: 

The `from_pretrained` method should point to a directory. Could you try to point it to a directory containing both the model weights and the config.json file?<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
