加载模型时出现报错:TypeError: stat: path should be string, bytes, os.PathLike or integer, not BertConfig

加载模型时出现报错:TypeError: stat: path should be string, bytes, os.PathLike or integer, not BertConfig

img

img

请问该怎么解决?

原因:找不到文件bindepend.py文件。

你试下config=self.config.model_name_or_path试下

self.config.model_name_or_path变量的值有问题, 应该是路径。 你把self.config.model_name_or_path, print出来看看值。