【问题标题】:Unable to import Hugging Face transformers无法导入拥抱脸转换器
【发布时间】:2021-03-30 15:26:49
【问题描述】:

直到今天,我一直在使用变压器。但是,我今天导入包的时候,收到了这个错误信息:

In Transformers v4.0.0, the default path to cache downloaded models changed from '~/.cache/torch/transformers' to '~/.cache/huggingface/transformers'. Since you don't seem to have overridden and '~/.cache/torch/transformers' is a directory that exists, we're moving it to '~/.cache/huggingface/transformers' to avoid redownloading models you have already in the cache. You should only see this message once.

Error: Destination path '/home/user/.cache/huggingface/transformers/transformers' already exists

我已尝试安装和卸载该软件包,但仍然无法正常工作。

任何解决此问题的建议将不胜感激。

【问题讨论】:

    标签: python huggingface-transformers


    【解决方案1】:

    由于它似乎是一个缓存文件,只需将 /huggingface/ 目录移动到 /huggingface.bak

    那么你应该可以重新运行脚本了。

    【讨论】:

    • 感谢您的建议。它现在正在工作!
    【解决方案2】:

    感谢 Joshua,通过以下命令解决了上述问题:

      mv ~/.cache/huggingface/transformers ~/.cache/huggingface-tmp
    

    【讨论】:

      猜你喜欢
      • 2021-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-26
      • 2021-09-15
      • 2022-06-28
      • 2021-08-10
      • 2020-11-28
      相关资源
      最近更新 更多