SoftMaskedBert icon indicating copy to clipboard operation
SoftMaskedBert copied to clipboard

想问一下这个报错怎么解决

Open Oldsport-996 opened this issue 2 years ago • 3 comments

404 Client Error: Not Found for url: https://huggingface.co//model/chinese-bert-wwm-ext/resolve/main/config.json Traceback (most recent call last): File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 512, in get_config_dict resolved_config_file = cached_path( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\file_utils.py", line 1370, in cached_path output_path = get_from_cache( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\file_utils.py", line 1541, in get_from_cache r.raise_for_status() File "H:\Anaconda\envs\softmasked\lib\site-packages\requests\models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co//model/chinese-bert-wwm-ext/resolve/main/config.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:/0:学习资料/0:研究生/0:纠正错误/SoftMaskedBert-main/model/train.py", line 252, in handler = engines(config) File "F:/0:学习资料/0:研究生/0:纠正错误/SoftMaskedBert-main/model/train.py", line 22, in init super(engines, self).init(config) File "F:\0:学习资料\0:研究生\0:纠正错误\SoftMaskedBert-main\model\model.py", line 29, in init self.bert = BertModel.from_pretrained(self.config.bert_path) File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\modeling_utils.py", line 1187, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 455, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs) File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 532, in get_config_dict raise EnvironmentError(msg) OSError: Can't load config for '/model/chinese-bert-wwm-ext'. Make sure that:

  • '/model/chinese-bert-wwm-ext' is a correct model identifier listed on 'https://huggingface.co/hfl'

  • or '/model/chinese-bert-wwm-ext' is the correct path to a directory containing a config.json file

我锁定不到要修改的位置

Oldsport-996 avatar Apr 20 '22 07:04 Oldsport-996

似乎是预训练模型名字不对的问题(可能是改了), 去huggingface官网里找个自己需要的模型替换就行

quantum00549 avatar Apr 21 '22 01:04 quantum00549

不知道解决了没有,同样遇到这个问题

lewispony avatar Jun 02 '22 01:06 lewispony

不知道解决了没有,同样遇到这个问题 最佳的解决思路就是, 去transformer官网找个确定有的模型, 然后挂VPN, 代码检测不到本地模型文件的时候会自动下载

quantum00549 avatar Jun 02 '22 01:06 quantum00549