can't load the model
>>> model = BertModel.from_pretrained('bert-large-cased')
Model name 'bert-large-cased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-cased.tar.gz' was a path or url but couldn't find any file associated to this path or url.
Strange error.

Can you try:
```python
import pytorch_pretrained_bert as ppb
assert 'bert-large-cased' in ppb.modeling.PRETRAINED_MODEL_ARCHIVE_MAP
```
Do you have an open internet connection on the server that run the script?<|||||>@thomwolf Is there a way to point to a model on disk? This question seems related enough to daisychain with this issue. :-)<|||||>I noticed that this error happens when you exceed the disk space in the temporary directory while downloading BERT.<|||||>I ran into the same problem. When I used the Chinese pre-training model, it was sometimes good and sometimes bad.<|||||>@thomwolf I've been having the same error, and I received an AssertionError when I try 

assert 'bert-based-uncased' in bert.modeling.PRETRAINED_MODEL_ARCHIVE_MAP

I've tried using both conda install and Pip install to get the package but in both cases I am not able to load any models<|||||>Hi @DuncanCam-Stein,
Which version of python do you have?
Can you try to install from source?<|||||>@thomwolf  @countback  
I finally fixed the problem by downloading the tf checkpoints directly from [here](https://github.com/google-research/bert), and then using the '[convert_tf_checkpoint_to_pytorch.py](https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py)' function to create a `pytorch_model.bin` file.
I then used the path to pytorch_model.bin and bert_config.json file in BertModel.from_pretrained('path/to/bin/and/json') instead of 'bert-base-uncased'.
👍 
Helpful info was found [here](https://devhub.io/repos/huggingface-pytorch-pretrained-BERT).<|||||>The network connection check has been relaxed in the now merged #500.
Serialization of the model have also been simplified a lot with #489.

These improvements will be included in the next PyPI release (probably next week).

In the meantime you can install from `master` and already use the serialization best-practices described in the README [here](https://github.com/huggingface/pytorch-pretrained-BERT#serialization-best-practices)<|||||>As @martiansideofthemoon said, I met this error because I didn't have enough space on disk.

Check if you can download the file with :

`wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz`<|||||>@martiansideofthemoon What does that mean if we can download it via wget but not when we use from_pretrained? is it a disk space problem?
<|||||>@Hannabrahman 
If you can download it via wget, it means you have enough disk space, so the issue is from somewhere else.<|||||>@Colanim Thanks. I figured out it was memory issue on the cache directory. <|||||>@Hannabrahman 

> @Colanim Thanks. I figured out it was memory issue on the cache directory.

how did you solve this issue?<|||||>@raj5287 
Free some disk space on the cache directory or specify another cache directory <|||||>@Colanim i have enough disk space since i have downloaded the file using 
`wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz` but i am not sure how to specify another cache directory or use the downloaded file (i am new to pytorch and ubuntu :|   )<|||||>> @thomwolf @countback
> I finally fixed the problem by downloading the tf checkpoints directly from [here](https://github.com/google-research/bert), and then using the '[convert_tf_checkpoint_to_pytorch.py](https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py)' function to create a `pytorch_model.bin` file.
> I then used the path to pytorch_model.bin and bert_config.json file in BertModel.from_pretrained('path/to/bin/and/json') instead of 'bert-base-uncased'.
> +1
> Helpful info was found [here](https://devhub.io/repos/huggingface-pytorch-pretrained-BERT).

@DuncanCam-Stein i have downloaded and placed _pytorch_model.bin_ and _bert_config.json_ in _bert_tagger_ folder but when i am doing `tokenizer = BertModel.from_pretrained('home/user/Download/bert_pos_tagger/bert_tagger/')` i am still getting the error : `Model name 'home/user/Downloads/bert_pos_tagger/bert_tagger/' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'home/user/Downloads/bert_pos_tagger/bert_tagger/' was a path or url but couldn't find any file associated to this path or url.`<|||||>try to delete cahe file and rerun the command<|||||>I noticed that the error appears when I execute my script in debug mode (in Visual Studio Code). I fixed it by executing the script over the terminal `python myscriptname.py` once. Afterwards Debug mode works fine. 

Btw. I got the same problem with the tokenizer and this also fixed it.<|||||>> > > > model = BertModel.from_pretrained('bert-large-cased')
> > > > Model name 'bert-large-cased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-cased.tar.gz' was a path or url but couldn't find any file associated to this path or url.

hello，I meet the problem when run the torch bert code 👍 

OSError: Can't load weights for 'bert-base-uncased'. Make sure that:

- 'bert-base-uncased' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'bert-base-uncased' is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt.
if I can download the bert-base-uncased weight, where I should put the file in ? hope your reply~<|||||>@DTW1004 check your network connection. This happens when I'm behind a proxy and SSL/proxy isn't configured appropriately.<|||||>bro，I've been having the same error. and then I try to debug the specific code
BertTokenizer.from_pretrained(MODEL_NAME)
step in to the origin code, I find  that I could step every line of the transformer in the debug mode. when step out origin code, the tokenizer tool could be used. what‘s more , the code could be run normaly in the next time I run the code. <|||||>I met the issue and I found the reason is that my server connecting was offline.<|||||>Running into the same issue on AWS Lambda. Neither relative and absolute paths will allow the model to load from pre-trained. <|||||>Here's what I am doing:

```shell
!wget -q https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-multilingual-cased.tar.gz
!tar xf bert-base-multilingual-cased.tar.gz
```

Now, if I do:

```python
encoder = TFBertModel.from_pretrained("bert-base-multilingual-cased")
```

I still get:

```shell
OSError: Can't load config for 'bert-base-multilingual-cased'. Make sure that:

- 'bert-base-multilingual-cased' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'bert-base-multilingual-cased' is the correct path to a directory containing a config.json file
```<|||||>Here's what I am doing:

from transformers import pipeline

def corret_sentence(sentence,unmasker):
    res = unmasker(sentence)
    return res 

if __name__=='__main__':
    sentence = "关小彤"
    new_sentence = ""
    unmasker = pipeline('fill-mask', model='uer/chinese_roberta_L-2_H-512')                                                                                                                                                                                                                    
    for idx,ch in enumerate(sentence): 
        new_sentence = sentence[:idx] + "[MASK]" + sentence[idx+1:]
        print(corret_sentence(new_sentence,unmasker))

I get:

ValueError: Could not load model uer/chinese_roberta_L-2_H-512 with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForMaskedLM'>, <class 'transformers.models.bert.modeling_bert.BertForMaskedLM'>).<|||||>> Here's what I am doing:
> 
> from transformers import pipeline
> 
> def corret_sentence(sentence,unmasker): res = unmasker(sentence) return res
> 
> if **name**=='**main**': sentence = "关小彤" new_sentence = "" unmasker = pipeline('fill-mask', model='uer/chinese_roberta_L-2_H-512') for idx,ch in enumerate(sentence): new_sentence = sentence[:idx] + "[MASK]" + sentence[idx+1:] print(corret_sentence(new_sentence,unmasker))
> 
> I get:
> 
> ValueError: Could not load model uer/chinese_roberta_L-2_H-512 with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForMaskedLM'>, <class 'transformers.models.bert.modeling_bert.BertForMaskedLM'>).

how could solve this?


did you solve this problem?

i am also having sample<|||||>> Free some disk space

how can I free some disk space.
which shell command should i use？<|||||>> @thomwolf @countback I finally fixed the problem by downloading the tf checkpoints directly from [here](https://github.com/google-research/bert), and then using the '[convert_tf_checkpoint_to_pytorch.py](https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py)' function to create a `pytorch_model.bin` file. I then used the path to pytorch_model.bin and bert_config.json file in BertModel.from_pretrained('path/to/bin/and/json') instead of 'bert-base-uncased'. 👍 Helpful info was found [here](https://devhub.io/repos/huggingface-pytorch-pretrained-BERT).

Can you please specify which model exactly you downloaded and how you ran the function? Thanks