Couldn't reach server 
Author: rabeehk
Pull request: no
Labels: name: wontfix

Hi I am running the very first example in readme. I got these errors, thanks for your help

Couldn't reach server to download vocabulary.
Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-config.json' to download pretrained model configuration file.
Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-pytorch_model.bin' to download pretrained weights.
Traceback (most recent call last):


Comments:
If I click on the links you provided above, they are currently reachable for me...
It may be a silly suggestions, but could it be that your internet connection was momentarily down when the code tried download those files or somehow you are not allowed to reach data on s3?

I have an idea about it. We can download the file from local computer, and send the file to the location of pytorch_transformers, for example:
/root/anaconda3/lib/python3.6/site-packages/pytorch_transformers
After that, we need to modify the modeling_bert.py in this folder:
https://github.com/huggingface/pytorch-transformers/blob/master/pytorch_transformers/modeling_bert.py


Are you behind a proxy maybe?

You can now give proxies parameters to the `from_pretrained` methods e.g.:
```python
proxies = {
  "http": "http://10.10.1.10:3128",
  "https": "https://10.10.1.10:1080",
}
model = BertModel.from_pretrained('bert-base-uncased', proxies=proxies)
```

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.


Can you try installing `pyopenssl` using this command. 
`pip install pyopenssl`
This worked for me. I guess the requests library is unable to establish an SSL connection, due to which the downloads are failing. Installing `pyopenssl` should solve the problem.


Hello, I am also facing this same error when running on AWS Lambda: 
`module initialization error: Couldn't reach server at '{}' to download vocabulary files.`

I've added proxies and installed pyopenssl as suggested by @thomwolf and @saradhix. It doesn't solve this issue. 

Do you have any further ideas please? 

I am calling the "fill-mask" pipeline with "camembert-base". 

Thank you!

> Can you try installing `pyopenssl` using this command.
> `pip install pyopenssl`
> This worked for me. I guess the requests library is unable to establish an SSL connection, due to which the downloads are failing. Installing `pyopenssl` should solve the problem.

@saradhix what are the changes you've made on the source code to use `pyopenssl` instead of `requests`? 
Thanks!

@ZiedHY I made no changes other than installing the `pyopenssl` package. I guess the `requests` module might internally use the `pyopenssl` for making secure connections.

> Hello, I am also facing this same error when running on AWS Lambda:
> `module initialization error: Couldn't reach server at '{}' to download vocabulary files.`
> 
> I've added proxies and installed pyopenssl as suggested by @thomwolf and @saradhix. It doesn't solve this issue.
> 
> Do you have any further ideas please?
> 
> I am calling the "fill-mask" pipeline with "camembert-base".
> 
> Thank you!

This seems to be a different problem. Why is the server url not getting printed in the error message?
`Couldn't reach server at '{}'`
See the error message posted by @rabeehk  at the top, which contains the full url. Your issue seems to be different.

Thank you @saradhix. You're right. It comes closer to this [issue](https://github.com/huggingface/transformers/issues/2116).