目录

1.OSError

2.解决方法

3.运行存在问题


1.OSError加载模型文件出现

OSError: Can’t load tokenizer for ‘bert-base-chinese’. If you were trying to load it from ‘https://huggingface.co/models’, make sure you don’t have a local directory with the same name. Otherwise, make sure ‘bert-base-chinese’ is the correct path to a directory containing allrelevant files for a BertTokenizer tokenizer.

原因:无法访问https://huggingface.co/网络

2.解决方法

本地下载,链接https://huggingface.co/google-bert/bert-base-uncased/tree/main,将以下三个文件下载到本地

然后将net/clip.py的from_pretrained()部分换为下载了以上模型的绝对路径。

继续运行发现存在np版本更新的问题,将utils/utils_aug.py的np.int换为np

3.运行成功

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐