RuntimeError when running on Colab GPU


I am trying to train a model for token classification (NER), more or less following the example on the Huggingface course on Token Classification.

When I attempt to initiate arguments, using transformers.TrainingArguments, as below:

from transformers import TrainingArguments

args = TrainingArguments(

I get the error:

RuntimeError: Failed to import transformers.training_args because of the following error (look up to see its traceback):
/usr/local/lib/python3.7/dist-packages/ undefined symbol: _ZN2at13_foreach_erf_EN3c108ArrayRefINS_6TensorEEE

Why is this? Is this a bug for transformers on Colab GPUs?

1 Like

Can you provide a Colab to reproduce this error? What’s your Transformers version?

Same issue here when following the Fine-tuning a masked language model tutorial with a GPU Colab instance, which installs transformers v4.12.5 and torch v1.10. Could this be linked to the installation of pytorch from a TPU wheel in the first cell?

EDIT: opened an issue in the notebooks repo: `undefined symbol` error when running chapter 7 notebooks on a GPU instance · Issue #120 · huggingface/notebooks · GitHub