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

相关推荐
Chef_Chen15 分钟前
从0开始学习机器学习--Day22--优化总结以及误差作业(上)
人工智能·学习·机器学习
Mr.简锋20 分钟前
opencv常用api
人工智能·opencv·计算机视觉
华清元宇宙实验中心25 分钟前
【每天学点AI】前向传播、损失函数、反向传播
深度学习·机器学习·ai人工智能
DevinLGT1 小时前
6Pin Type-C Pin脚定义:【图文讲解】
人工智能·单片机·嵌入式硬件
宋一诺331 小时前
机器学习—高级优化方法
人工智能·机器学习
龙的爹23331 小时前
论文 | The Capacity for Moral Self-Correction in LargeLanguage Models
人工智能·深度学习·机器学习·语言模型·自然语言处理·prompt
Mr.简锋1 小时前
opencv视频读写
人工智能·opencv·音视频
Baihai_IDP1 小时前
「混合专家模型」可视化指南:A Visual Guide to MoE
人工智能·llm·aigc
寰宇视讯2 小时前
“津彩嘉年,洽通天下” 2024中国天津投资贸易洽谈会火热启动 首届津彩生活嘉年华重磅来袭!
大数据·人工智能·生活
Light602 小时前
低代码牵手 AI 接口:开启智能化开发新征程
人工智能·python·深度学习·低代码·链表·线性回归