# No validation metrics shown durning traing

**URL:** <https://discuss.huggingface.co/t/no-validation-metrics-shown-durning-traing/14266>\
**Category:** 🤗Transformers\
**Created:** [January 31, 2022, 3:39pm UTC](https://discuss.huggingface.co/t/no-validation-metrics-shown-durning-traing/14266 "2022-01-31T15:39:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![duleepx](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@duleepx](https://discuss.huggingface.co/u/duleepx)\
**Post date:** [January 31, 2022, 3:39pm UTC](https://discuss.huggingface.co/t/no-validation-metrics-shown-durning-traing/14266/1 "2022-01-31T15:39:25Z")

</div>

Fine turning of Bert/DistilBert models don’t show the validation metrics during training even though evaluation\_strategy in TrainingArguments is set to epoch/steps and compute metrics are defined as follows.

def compute\_metrics(p):  
pred, labels = p  
pred = np.argmax(pred, axis=1)  
accuracy = accuracy\_score(y\_true=labels, y\_pred=pred)  
recall = recall\_score(y\_true=labels, y\_pred=pred)  
precision = precision\_score(y\_true=labels, y\_pred=pred)  
f1 = f1\_score(y\_true=labels, y\_pred=pred)  
return {“accuracy”: accuracy, “precision”: precision, “recall”: recall, “f1”: f1}

training\_args = TrainingArguments(  
output\_dir=’/home/dxr8k83/CatelogBert\_V1.1/out/’,  
num\_train\_epochs=1,  
per\_device\_train\_batch\_size=32,  
per\_device\_eval\_batch\_size=16,  
warmup\_steps=10,  
weight\_decay=0.01,  
learning\_rate = 5e-04,  
logging\_dir=’./logs’,  
logging\_steps=10,  
evaluation\_strategy=‘steps’,  
load\_best\_model\_at\_end = True,  
)

trainer = Trainer(  
model=model,  
args=training\_args,  
train\_dataset=train\_dataset,  
eval\_dataset=val\_dataset,  
compute\_metrics = compute\_metrics,  
)

trainer.train()
