本文主要是介绍引入BertTokenizer出现OSError: Can‘t load tokenizer for ‘bert-base-uncased‘.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天在跑一个模型的时候出现该报错,完整报错为:
OSError: Can't load tokenizer for 'bert-base-uncased'. 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-uncased' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.
找了半天一直没找到解决方案,最后发现是transformers库的版本问题,要么在终端运行:
conda install transformers
要么就是更新该库transformers
就能解决了。
这篇关于引入BertTokenizer出现OSError: Can‘t load tokenizer for ‘bert-base-uncased‘.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!