bert-base-cased问题

Traceback (most recent call last):

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 802, in urlopen

**response_kw,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 491, in _make_request

raise new_e

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 467, in _make_request

self._validate_conn(conn)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn

conn.connect()

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connection.py", line 658, in connect

assert_fingerprint=self.assert_fingerprint,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connection.py", line 793, in _ssl_wrap_socket_and_match_hostname

tls_in_tls=tls_in_tls,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 469, in ssl_wrap_socket

ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 513, in _ssl_wrap_socket_impl

return ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 423, in wrap_socket

session=session

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 870, in _create

self.do_handshake()

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 1139, in do_handshake

self._sslobj.do_handshake()

ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/adapters.py", line 497, in send

chunked=chunked,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 845, in urlopen

method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/retry.py", line 470, in increment

raise reraise(type(error), error, _stacktrace)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/util.py", line 38, in reraise

raise value.with_traceback(tb)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 802, in urlopen

**response_kw,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 491, in _make_request

raise new_e

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 467, in _make_request

self._validate_conn(conn)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn

conn.connect()

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connection.py", line 658, in connect

assert_fingerprint=self.assert_fingerprint,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/connection.py", line 793, in _ssl_wrap_socket_and_match_hostname

tls_in_tls=tls_in_tls,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 469, in ssl_wrap_socket

ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 513, in _ssl_wrap_socket_impl

return ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 423, in wrap_socket

session=session

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 870, in _create

self.do_handshake()

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/ssl.py", line 1139, in do_handshake

self._sslobj.do_handshake()

urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/transformers/modeling_utils.py", line 903, in from_pretrained

local_files_only=local_files_only,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/transformers/file_utils.py", line 723, in cached_path

local_files_only=local_files_only,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/transformers/file_utils.py", line 902, in get_from_cache

http_get(url, temp_file, proxies=proxies, resume_size=resume_size, user_agent=user_agent)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/transformers/file_utils.py", line 782, in http_get

response = requests.get(url, stream=True, proxies=proxies, headers=headers)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/api.py", line 73, in get

return request("get", url, params=params, **kwargs)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/api.py", line 59, in request

return session.request(method=method, url=url, **kwargs)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/sessions.py", line 589, in request

resp = self.send(prep, **send_kwargs)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/sessions.py", line 703, in send

r = adapter.send(request, **kwargs)

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/requests/adapters.py", line 501, in send

raise ConnectionError(err, request=request)

requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "run_bertrl.py", line 320, in <module>

main()

File "run_bertrl.py", line 130, in main

cache_dir=model_args.cache_dir,

File "/home/zeus/anaconda3/envs/BERTRL/lib/python3.7/site-packages/transformers/modeling_utils.py", line 913, in from_pretrained

raise EnvironmentError(msg)

OSError: Can't load weights for 'bert-base-cased'. Make sure that:

  • 'bert-base-cased' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'bert-base-cased' is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt.

1.bert-base-cased在网上自动下载要连接外网

2.本地下载。放入项目中'https://huggingface.co/models

相关推荐
这张生成的图像能检测吗16 小时前
(论文速读)EfficientTrain++: 高效视觉骨干训练的通用课程学习
人工智能·深度学习·计算机视觉·训练方法
晚霞的不甘17 小时前
CANN:华为全栈AI计算框架的深度解析(终极扩展版 · 完整篇)
人工智能·华为
lisw0519 小时前
6G频段与5G频段有何不同?
人工智能·机器学习
2501_9416233221 小时前
人工智能赋能智慧农业互联网应用:智能种植、农业数据分析与产量优化实践探索》
大数据·人工智能
不爱吃糖的程序媛21 小时前
华为 CANN:昇腾 AI 的异构计算架构核心与开源生态解析
人工智能·华为·架构
AKAMAI21 小时前
从客户端自适应码率流媒体迁移到服务端自适应码率流媒体
人工智能·云计算
jinxinyuuuus21 小时前
GTA 风格 AI 生成器:跨IP融合中的“视觉语义冲突”与风格适配损失
人工智能·网络协议
如何原谅奋力过但无声21 小时前
TensorFlow 1.x常用函数总结(持续更新)
人工智能·python·tensorflow
翔云 OCR API21 小时前
人脸识别API开发者对接代码示例
开发语言·人工智能·python·计算机视觉·ocr