在尝试使用 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_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\util\connection.py", line 95, in create_connection
raise err
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\util\connection.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_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connectionpool.py", line 710, in urlopen
chunked=chunked,
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connection.py", line 358, in connect
conn = self._new_conn()
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x00000206A95A1908>: 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_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\requests\adapters.py", line 450, in send
timeout=timeout
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\connectionpool.py", line 786, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\urllib3\util\retry.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('<urllib3.connection.HTTPSConnection object at 0x00000206A95A1908>: 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 <module>
biobert = BiobertEmbedding()
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\biobert_embedding\embedding.py", line 32, in __init__
self.model_path = downloader.get_BioBert("google drive")
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\biobert_embedding\downloader.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_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\biobert_embedding\downloader.py", line 15, in download_file_from_google_drive
response = session.get(URL, params = { 'id' : id }, stream = True, verify = False)
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\requests\sessions.py", line 542, in get
return self.request('GET', url, **kwargs)
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\requests\sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\requests\sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "D:\compile_language\anaconda3\envs\chainer_gpu_test\lib\site-packages\requests\adapters.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('<urllib3.connection.HTTPSConnection object at 0x00000206A95A1908>: 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 文件夹底下他再检测的时候就不会重新下载了
|