# Getting error in importing TFTrainer

**URL:** <https://discuss.huggingface.co/t/getting-error-in-importing-tftrainer/77416>\
**Category:** 🤗Transformers\
**Created:** [March 14, 2024, 1:17pm UTC](https://discuss.huggingface.co/t/getting-error-in-importing-tftrainer/77416 "2024-03-14T13:17:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivdattaredekar](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@shivdattaredekar](https://discuss.huggingface.co/u/shivdattaredekar)\
**Post date:** [March 14, 2024, 1:17pm UTC](https://discuss.huggingface.co/t/getting-error-in-importing-tftrainer/77416/1 "2024-03-14T13:17:11Z")

</div>

i tried importing TFTTrainer with below code

from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments

## but got the below error 🙂

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 🙂

---

<div class="post-metadata">

**Author:** ![skushwa1](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@skushwa1](https://discuss.huggingface.co/u/skushwa1)\
**Post date:** [July 22, 2024, 7:03pm UTC](https://discuss.huggingface.co/t/getting-error-in-importing-tftrainer/77416/2 "2024-07-22T19:03:26Z")

</div>

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.

🙂
