# Error - RuntimeError

**URL:** <https://discuss.huggingface.co/t/error-runtimeerror/65942>\
**Category:** 🤗Transformers\
**Created:** [December 15, 2023, 11:44am UTC](https://discuss.huggingface.co/t/error-runtimeerror/65942 "2023-12-15T11:44:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritu98](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@ritu98](https://discuss.huggingface.co/u/ritu98)\
**Post date:** [December 15, 2023, 11:44am UTC](https://discuss.huggingface.co/t/error-runtimeerror/65942/1 "2023-12-15T11:44:42Z")

</div>

ERROR - Error - RuntimeError: Failed to import transformers.trainer\_tf because of the following error (look up to see its traceback): cannot import name ‘check\_peft\_version’ from ‘transformers.utils’ (C:\Users\abcd\Local\anaconda3\Lib\site-packages\transformers\utils\__init_\_.py)  
code - from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments  
training\_args = TFTrainingArguments(  
num\_train\_epochs=7,  
per\_device\_train\_batch\_size=16,  
per\_device\_eval\_batch\_size=64,  
warmup\_steps=500,  
weight\_decay=1e-5,  
eval\_steps=100  
)

with training\_args.strategy.scope():  
trainer\_model = TFDistilBertForSequenceClassification.from\_pretrained(‘distilbert-base-uncased’, num\_labels = 5 )  
trainer = TFTrainer(  
model=trainer\_model,  
args=training\_args,  
train\_dataset=train\_dataset,  
eval\_dataset=val\_dataset,  
)
