Getting error in importing TFTrainer

i tried importing TFTTrainer with below code

from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments

but got the below error :slight_smile:

ImportError Traceback (most recent call last)
Cell In[85], line 1
----> 1 from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments

ImportError: cannot import name ‘TFTrainer’ from ‘transformers’ (C:\Users\sredekar\AppData\Roaming\Python\Python311\site-packages\transformers_init_.py)

can anyone help :slight_smile:

I am sharing one solution that I found, I hope this helps try installing !pip install transformers==4.18.0 as newer versions does not support TFTrainer.

:slight_smile: