# Getting No log in validation\_loss

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-no-log-in-validation-loss%2F140868%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 14, 2025, 3:01pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-no-log-in-validation-loss%2F140868 "2025-02-14T15:01:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [February 14, 2025, 3:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-no-log-in-validation-loss%2F140868%2F2 "2025-02-14T15:16:29Z")

</div>

Perhaps this?

> [@'No Log' for validation loss during training with Trainer](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fno-log-for-validation-loss-during-training-with-trainer%2F40094)%3A
>
> Hello, I’m trying to fine-tune a Custom BertModel on a sequence classification task, but I’m having some issues getting the Trainer to log the validation loss. Specifically, the log looks like this: Here is the code I’m using: from datasets import load\_dataset import torch.nn as nn from transformers import ( AutoModel, AutoModelForSequenceClassification, AutoTokenizer, DataCollatorWithPadding, Trainer, TrainingArguments ) class CustomTrainer(Trainer):…

> For LLM validation loss you might also need `label_names=[]` in the TrainingArguments and set `trainer.can_return_loss = True` to satisfy [transformers/src/transformers/trainer.py at v4.40.2 · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/trainer.py#L3796) for some models.

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-no-log-in-validation-loss%2F140868)._
