栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

biobertEmbedding TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

biobertEmbedding TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

在尝试使用 biobertEmbedding 来处理 genia 预训练词向量的时候,发现运行

from biobert_embedding.embedding import BiobertEmbedding
biobert = BiobertEmbedding()

的时候,会报错

Downloading the biobert model, will take a minute...
Traceback (most recent call last):
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connection.py", line 175, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3utilconnection.py", line 95, in create_connection
    raise err
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3utilconnection.py", line 85, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connectionpool.py", line 710, in urlopen
    chunked=chunked,
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connectionpool.py", line 1040, in _validate_conn
    conn.connect()
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connection.py", line 358, in connect
    conn = self._new_conn()
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connection.py", line 187, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesrequestsadapters.py", line 450, in send
    timeout=timeout
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3connectionpool.py", line 786, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesurllib3utilretry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='docs.google.com', port=443): Max retries exceeded with url: /uc?export=download&id=1TFtdE5pu0LiFTD4p7NEESwyVbhrY2_04 (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "balabala", line 24, in 
    biobert = BiobertEmbedding()
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesbiobert_embeddingembedding.py", line 32, in __init__
    self.model_path = downloader.get_BioBert("google drive")
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesbiobert_embeddingdownloader.py", line 65, in get_BioBert
    download_file_from_google_drive(gdd_id, model_path/"biobert_v1.1_pubmed_pytorch_model.tar.gz")
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesbiobert_embeddingdownloader.py", line 15, in download_file_from_google_drive
    response = session.get(URL, params = { 'id' : id }, stream = True, verify = False)
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesrequestssessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesrequestssessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesrequestssessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "D:compile_languageanaconda3envschainer_gpu_testlibsite-packagesrequestsadapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='docs.google.com', port=443): Max retries exceeded with url: /uc?export=download&id=1TFtdE5pu0LiFTD4p7NEESwyVbhrY2_04 (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。',))

Process finished with exit code 1

那这个问题肯定是因为,我不能翻墙,所以连不上 docs.google.com,既然不能从pycharm/terminal里面运行,那我就自己下载完了上传上去

google chrome里面有免费的软件,直接一个登录,根据报错和源码进入下载网址
下好了放到 biobert_v1.1_pubmed_pytorch_model 文件夹底下他再检测的时候就不会重新下载了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/757805.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号