【问题标题】:Huggingface transformers error: "from transformers.trainer_utils import get_last_checkpoint,is_main_process"Huggingface 变压器错误:“从 transformers.trainer_utils 导入 get_last_checkpoint,is_main_process”
【发布时间】:2021-05-05 01:34:02
【问题描述】:

我正在使用 Google Colab 并尝试使用 transformers。首先,我使用pip安装了trasnformers,安装成功了但是还是无法导入以下函数

from transformers.trainer_utils import get_last_checkpoint,is_main_process

接下来我尝试在虚拟环境中从源代码安装Transformers。我安装成功了,但还是出现如​​下所示的错误。

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-53-d42272f1d6ac> in <module>()
----> 1 from transformers.trainer_utils import get_last_checkpoint,is_main_process

ModuleNotFoundError: No module named 'transformers.trainer_utils'

【问题讨论】:

  • 你安装了哪个版本(import transformerstransformers.__version__)?
  • 感谢您的回复。从源代码安装“主”版本后修复了该问题。 "pip install git+github.com/huggingface/transformers"

标签: tensorflow google-colaboratory huggingface-transformers


【解决方案1】:

来自 cmets

如图所示从源安装“master”版本后修复的问题 下面

pip install git+github.com/huggingface/transformers

【讨论】:

    猜你喜欢
    • 2021-05-07
    • 2021-01-14
    • 2021-06-28
    • 1970-01-01
    • 2020-07-22
    • 1970-01-01
    • 2020-09-06
    • 2021-06-09
    • 2020-11-04
    相关资源
    最近更新 更多