运行Clip多模态模型报错:OSError: Can‘t load tokenizer for ‘bert-base-chinese‘
然后将net/clip.py的from_pretrained()部分换为下载了以上模型的绝对路径。继续运行发现存在np版本更新的问题,将utils/utils_aug.py的np.int换为np。1.OSError加载模型文件出现。,将以下三个文件下载到本地。
·
目录
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.运行成功

更多推荐

所有评论(0)