# 2 evalset but got no validation loss

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%3E%5C
**Category:** Beginners\
**Created:** [April 1, 2024, 1:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575 "2024-04-01T01:56:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nevermetyou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nevermetyou/32/21618_2.png) [@Nevermetyou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNevermetyou)%5C
**Post date:** [April 1, 2024, 1:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%2F1 "2024-04-01T01:56:09Z")

</div>

Hi, I am trying to pass 2 evaluation set to Trainer but a weird thing happen to me.  
I got no validaiton loss

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/b/d/bdb5727313c4638c0305466b217014d7a5d35003.png)

here is my training args

```auto
training_args_dict = {
    "output_dir": save_dir,
    "overwrite_output_dir": True,
    "logging_strategy": "epoch",
    "evaluation_strategy": "epoch",
    "save_strategy": "epoch",
    "per_device_train_batch_size": batch_size,
    "per_device_eval_batch_size": batch_size,
    "save_total_limit": 1,
    "num_train_epochs": epochs,
    "predict_with_generate": True,
    "report_to": report_to,
    "run_name": run_name,
    "load_best_model_at_end": True,
    "seed": SEED,
    "generation_config": gen_config,
    "metric_for_best_model": "eval_validation_loss",
    # "disable_tqdm" : True,
}

```

here is my Trainer api

```auto
def get_trainer(
    input_col,
    label_col,
    model_name,
    path_to_hf_data,
    data_collator,
    training_args_dict,
    early_stop_round=20,
):
    tokenized_dataset = preprocess_text(path_to_hf_data, input_col, label_col)
    args = Seq2SeqTrainingArguments(**training_args_dict)
    optimizer = Adafactor(
        model.parameters(),
        scale_parameter=True,
        relative_step=True,
        warmup_init=True,
        lr=None,
    )
    trainer = Seq2SeqTrainer(
        model=model,
        args=args,
        train_dataset=tokenized_dataset["train"],
        eval_dataset={
            "validation" : tokenized_dataset["valid"],
            "training" : tokenized_dataset["train"],
        },
        data_collator=data_collator,
        tokenizer=tokenizer,
        compute_metrics=compute_metrics,
        optimizers=(optimizer, AdafactorSchedule(optimizer)),
        callbacks=[EarlyStoppingCallback(early_stopping_patience=early_stop_round)],
    )
    return trainer

```

Could someone help me with this matter? The Documenation is not clear to me how to pass 2 evaluation set to trainer.

---

<div class="post-metadata">

**Author:** ![swtb](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@swtb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fswtb)%5C
**Post date:** [April 3, 2024, 1:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%2F2 "2024-04-03T13:09:39Z")

</div>

Unless you have a specific reason, its best to evaluate without the training dataset.

Pass as `eval_dataset=tokenized_dataset['valid']`

---

<div class="post-metadata">

**Author:** ![Nevermetyou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nevermetyou/32/21618_2.png) [@Nevermetyou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNevermetyou)%5C
**Post date:** [April 15, 2024, 12:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%2F3 "2024-04-15T12:51:29Z")

</div>

The reason for this is I want to see the metric for the training set, too. The other day, I just saw a comment saying this was not the intention of trainer API, so I gave up on this.

---

<div class="post-metadata">

**Author:** ![swtb](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@swtb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fswtb)%5C
**Post date:** [April 15, 2024, 2:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%2F4 "2024-04-15T14:35:52Z")

</div>

I don’t think we can gain much additional context by evaluating on the training set. It’s kind of like doing an exam paper where you’ve already seen the questions.

---

<div class="post-metadata">

**Author:** ![Nevermetyou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nevermetyou/32/21618_2.png) [@Nevermetyou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNevermetyou)%5C
**Post date:** [April 17, 2024, 6:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F2-evalset-but-got-no-validation-loss%2F79575%2F5 "2024-04-17T06:41:27Z")

</div>

Thanks for your explanation
