【发布时间】: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 transformers,transformers.__version__)? -
感谢您的回复。从源代码安装“主”版本后修复了该问题。 "pip install git+github.com/huggingface/transformers"
标签: tensorflow google-colaboratory huggingface-transformers