# ReadTimeoutError when loading model

**URL:** <https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481>\
**Category:** Beginners\
**Created:** [October 17, 2024, 7:41am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481 "2024-10-17T07:41:48Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 18, 2024, 8:00am UTC](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481/6 "2024-10-18T08:00:49Z")

</div>

Yours appears to be a network, mainly SSL issue.

> <https://github.com/huggingface/transformers/issues/12575>
>
> Dear, 
> I am new in Transformers, I just tried to run the syntax below:
> 
> from …transformers import BertForSequenceClassification, AdamW, BertConfig
> model = BertForSequenceClassification.from\_pretrained(
> "bert-base-cased", 
> num\_labels = 2, 
> output\_attentions = False, 
> output\_hidden\_states = False 
> )
> 
> model.cuda()
> 
> 
> However, I got an error message like:
> 
> \`HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Max retries exceeded with url: /bert-base-cased/d6992b8cd27d7a132eafce6a8210272329a371b1c762d453588795dd3
> 835593e (Caused by NewConnectionError('\<urllib3.connection.HTTPSConnection object at 0x7ff9e60c6dd0\>: Failed to establish a new connection: \[Errno -2\] Name or service 
> not known'))
> Traceback (most recent call last):
> File "/root/anaconda3/envs/bert/lib/python3.7/site-packages/urllib3/connection.py", line 170, in \_new\_conn
> (self.\_dns\_host, self.port), self.timeout, \*\*extra\_kw
> File "/root/anaconda3/envs/bert/lib/python3.7/site-packages/urllib3/util/connection.py", line 73, in create\_connection
> for res in socket.getaddrinfo(host, port, family, socket.SOCK\_STREAM):
> File "/root/anaconda3/envs/bert/lib/python3.7/socket.py", line 752, in getaddrinfo
> for res in \_socket.getaddrinfo(host, port, family, type, proto, flags):
> socket.gaierror: \[Errno -2\] Name or service not known
> \`
> 
> Any suggestions on how to fix it?
> 
> Kind regards,
> 
> MY

> [@SSL Certificate Issue](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/7):
>
> 2 fixes quick one - on windows - pip install python-certifi-win32 preferred - install transformers package using the following command pip install transformers --use-feature=truststore

---

_[View the full topic](https://discuss.huggingface.co/t/readtimeouterror-when-loading-model/112481)._
