国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

報錯解決MaxRetryError(“HTTPSConnectionPool(host=‘huggingface.co‘, port=443):xxx“)

這篇具有很好參考價值的文章主要介紹了報錯解決MaxRetryError(“HTTPSConnectionPool(host=‘huggingface.co‘, port=443):xxx“)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

完整的錯誤信息

'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/vocab.txt (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f1320354880>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 625af900-631f-4614-9358-30364ecacefe)')' thrown while requesting HEAD https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/added_tokens.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f1320354d60>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 1679a995-7441-4afe-a685-9a7bd6da9f2a)')' thrown while requesting HEAD https://huggingface.co/bert-base-uncased/resolve/main/added_tokens.json
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/special_tokens_map.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f13202fb250>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 9af5b73e-5230-45d7-8886-5d37d38f09a8)')' thrown while requesting HEAD https://huggingface.co/bert-base-uncased/resolve/main/special_tokens_map.json
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/tokenizer_config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f13202fb730>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 12136040-d033-4099-821c-dcb80fb50018)')' thrown while requesting HEAD https://huggingface.co/bert-base-uncased/resolve/main/tokenizer_config.json
Traceback (most recent call last):
  File "/tmp/pycharm_project_494/Zilean-Classifier/main.py", line 48, in <module>
    tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
  File "/root/miniconda3/envs/DL/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1838, in from_pretrained
    raise EnvironmentError(
OSError: Can't load tokenizer for 'bert-base-uncased'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'bert-base-uncased' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.

首先造成這種錯誤的原因主要是因?yàn)槟愕姆?wù)器沒有辦法連接huggingface的原因,你可以直接在你的服務(wù)器上嘗試能否直接ping

ping huggingface.co

那我的機(jī)器就是沒有數(shù)據(jù)傳輸過來,當(dāng)然前提是你自己的服務(wù)器一定要有網(wǎng)絡(luò)連接(可以嘗試ping www.baidu.com來檢測自己機(jī)器是否有網(wǎng)絡(luò))。

解決方案1

使用VPN,這個方法比較適用機(jī)器是你自己的,如果機(jī)器不是你的,你搭VPN比較麻煩,因?yàn)樽獾姆?wù)器會定時清理,在Linux搭建VPN也很簡單,大家搜索一哈有很多方案

解決方案2【推薦】

第二種方式適用于租賃的機(jī)器的情況,就是直接將本地的下載好(你的本地也需要能訪問外網(wǎng))的預(yù)訓(xùn)練模型上傳上去,如果你已經(jīng)在你的本地簡單跑過代碼了,沒有就去官網(wǎng)下載,首先我們確定我們本地文件所處的路徑【windows下應(yīng)該在你的用戶文件下面又有個.cache,注意打開隱藏文件夾】:

  • 將指定的模型下載到本地【本地機(jī)器需要科學(xué)上網(wǎng)】

    from transformers import BertModel, BertTokenizer
    
    # 使用bert-large-uncased
    model = BertModel.from_pretrained('bert-large-uncased')
    tokenizer = BertTokenizer.from_pretrained('bert-large-uncased')
    

    此時你的機(jī)器上會出現(xiàn)如下圖片:
    報錯解決MaxRetryError(“HTTPSConnectionPool(host=‘huggingface.co‘, port=443):xxx“),服務(wù)器,linux

  • 找到本地下載好的模型文件

    • 如果你是windows用戶,你的用戶User文件下面又有個.cache/huggingface/hub/,注意打開隱藏文件;
    • 如果你是macos用戶在下面地址中
      ~/.cache/huggingface/hub/models--bert-base-uncased
      
  • 上傳文件到服務(wù)器上
    將本地文件上傳到服務(wù)器的下面地址中

    ~/.cache/huggingface/hub/models--bert-base-uncased
    

    就可以運(yùn)行你的代碼了,但是這里運(yùn)行的時候有個小問題,就是你運(yùn)行時候仍然會報錯說無法下載這些文件,請耐心等待,你的代碼會正常運(yùn)行
    報錯解決MaxRetryError(“HTTPSConnectionPool(host=‘huggingface.co‘, port=443):xxx“),服務(wù)器,linux

    如果你不想出現(xiàn)之前上面還顯示出錯的問題,那么修改之前的加載方法,之前的加載方法為:

    config = BertConfig.from_pretrained(model_name) 
    

    修改為

    # 指定本地bert模型路徑
    bert_model_dir = "/path/to/bert/model" 
    
    config = transformers.BertConfig.from_pretrained(bert_model_dir)
    

    即可文章來源地址http://www.zghlxwxcb.cn/news/detail-716341.html

到了這里,關(guān)于報錯解決MaxRetryError(“HTTPSConnectionPool(host=‘huggingface.co‘, port=443):xxx“)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • OpenAI調(diào)用API報錯 time out:HTTPSConnectionPool(host=‘a(chǎn)pi.openai.com‘, port=443)

    OpenAI調(diào)用API報錯 time out:HTTPSConnectionPool(host=‘a(chǎn)pi.openai.com‘, port=443)

    代碼如下(源自網(wǎng)絡(luò)): 執(zhí)行報錯: 參考大佬文章:傳送門 簡單來說就是 1.26.0 版本的urllib3添加了HTTPS支持,但代理服務(wù)器不支持HTTPS,所以報錯(pip走代理報錯也差不多類似原因,具體請參考上文,有詳細(xì)解讀) 這個方法對部分人有用,但很不幸我是另一部分(哭)! 查

    2024年02月06日
    瀏覽(25)
  • pip安裝模塊報錯ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org‘, port=443): Read timed

    今天在安裝python模塊時提示 ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out 具體報錯如下: 處理方法 pip --default-timeout=100 install -U pygame 這使用pip安裝超時,絕大多數(shù)原因是pip源在外國,所以國內(nèi)使用,網(wǎng)絡(luò)就算穩(wěn)定,也有一定超時。–default-timeo

    2024年02月11日
    瀏覽(21)
  • 報錯解決:urllib3.exceptions.MaxRetryError

    今天使用requests異步加載抓取數(shù)據(jù)的時候報錯: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=\\\'127.0.0.1\\\', port=6723):? Max retries exceeded with url:? /wd/hub/session (Caused by NewConnectionError (\\\'urllib3.connection.HTTPConnection object at 0x0000000003517D68: Failed to establish a new connection: [WinError 10061] 由于目標(biāo)計(jì)

    2024年02月15日
    瀏覽(17)
  • 下載torchvision報錯:Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.python

    下載torchvision報錯:Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.python

    報錯如下:Could not install packages due to an OSError: HTTPSConnectionPool(host=\\\'files.pythonhosted.org\\\', port=443): Max retries exceeded with url: /packages/c0/8f/dfa473f3a6241bff91ae8bb90 5bd0afceb827f37de2917a94b5c4b1112bf/Pillow-9.3.0-cp39-cp39-win_amd64.whl (Caused by ConnectTimeoutError(pip._vendor.urllib3.connection.HTTPSConnection object at 0x000

    2024年02月15日
    瀏覽(18)
  • huggingface.co下載模型

    huggingface.co下載模型

    1、在測試clip-interrogator 發(fā)現(xiàn)BLIP CLIP模型需要離線加載,以下手工下載并指定路徑。 并運(yùn)行TRANSFORMERS_OFFLINE=1 python run.py, run.py如下 其他huggingface的模型處理方法可參考。 2、BLIP模型 根據(jù)Readme指引下載,存,指定路徑即可。 BLIP//pretrained/model_base_caption_capfilt_large.pth ?BLIP//pretrai

    2024年02月04日
    瀏覽(17)
  • 解決requests.exceptions.ProxyError: HTTPSConnectionPool(host=‘a(chǎn)pi.github.com‘, port=443): Max retries

    一般來說,出現(xiàn)這種錯誤的原因可能是以下之一: 代理設(shè)置錯誤 : 你的計(jì)算機(jī)或網(wǎng)絡(luò)環(huán)境可能配置了代理服務(wù)器,但代理服務(wù)器設(shè)置可能不正確。你需要檢查你的代理設(shè)置是否正確,并確保它們與你的網(wǎng)絡(luò)環(huán)境相匹配。 代理服務(wù)器不可用 : 如果代理服務(wù)器無法訪問或不可用

    2024年02月05日
    瀏覽(43)
  • 解決.ReadTimeoutError: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn‘, port=443): Read timed o

    目錄 解決.ReadTimeoutError: HTTPSConnectionPool(host=\\\'pypi.tuna.tsinghua.edu.cn\\\', port=443): Read timed out 方法1:增加超時時間 方法2:更換pip源 方法3:使用國內(nèi)鏡像加速器 在Python開發(fā)中,我們經(jīng)常使用第三方庫來滿足各種需求。當(dāng)我們使用pip安裝這些庫時,有時可能會遇到一些網(wǎng)絡(luò)問題,特別

    2024年02月04日
    瀏覽(61)
  • 解決:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘x‘,port=x): Max retries exceeded with url

    解決:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘x‘,port=x): Max retries exceeded with url

    在使用selenium操作Chrome瀏覽器報錯:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘lv-pc-api-sinfonlineb.ulikecam.com’, port=443): Max retries exceeded with url: /get (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)’))) 報錯信息如下: 報錯截圖如下: 主要報錯信息內(nèi)容

    2024年02月21日
    瀏覽(16)
  • linux git clone出現(xiàn)OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to huggingface.co:443解決方案

    linux git clone出現(xiàn)OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to huggingface.co:443解決方案

    ??大家好,我是愛編程的喵喵。雙985碩士畢業(yè),現(xiàn)擔(dān)任全棧工程師一職,熱衷于將數(shù)據(jù)思維應(yīng)用到工作與生活中。從事機(jī)器學(xué)習(xí)以及相關(guān)的前后端開發(fā)工作。曾在阿里云、科大訊飛、CCF等比賽獲得多次Top名次?,F(xiàn)為CSDN博客專家、人工智能領(lǐng)域優(yōu)質(zhì)創(chuàng)作者。喜歡通過博客創(chuàng)作

    2024年02月08日
    瀏覽(17)
  • 已解決ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files.pyt

    已解決ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443) ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443) 對于\\\"Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files.p

    2024年02月06日
    瀏覽(19)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包