当前位置:   article > 正文

OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch

OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch

Transformers加载BERT出错。

错误:Exception has occurred: OSError Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

解决办法:把C:\Users\Administrator\.cache\huggingface\transformers下的文件删除后,重新下载加载就可以用。

如果不行,应该是版本问题。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/391973
推荐阅读
相关标签
  

闽ICP备14008679号