# Sam2.1 fine tuning problem for validation

**URL:** <https://discuss.roboflow.com/t/sam2-1-fine-tuning-problem-for-validation/8245>\
**Category:** 🤝  Community Help\
**Created:** [January 14, 2025, 12:39pm UTC](https://discuss.roboflow.com/t/sam2-1-fine-tuning-problem-for-validation/8245 "2025-01-14T12:39:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Semanur\_Küçük](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/semanur_k%C3%BC%C3%A7%C3%BCk/32/6374_2.png) [@Semanur\_Küçük](https://discuss.roboflow.com/u/Semanur_K%C3%BC%C3%A7%C3%BCk)\
**Post date:** [January 14, 2025, 12:39pm UTC](https://discuss.roboflow.com/t/sam2-1-fine-tuning-problem-for-validation/8245/1 "2025-01-14T12:39:21Z")

</div>

Hi all,

I’m currently following the steps outlined in guide to train SAM21 [[How to Fine-Tune SAM-2.1 on a Custom Dataset](https://blog.roboflow.com/fine-tune-sam-2-1/))]. However, I’ve encountered an issue regarding logging during training. In the `.yaml` file, the configuration is set as `mode: train_only`, which means the log files only include outputs for the training process.

I also have a validation dataset and would like to log the validation metrics during training, so I can later visualize them using TensorBoard. I tried modifying the `.yaml` file to include the validation set and logging, but I either encounter errors or the logs don’t show up as expected.

As my background is in mechanical engineering, I find some parts of the SAM2 codebase challenging to fully grasp. If you’ve encountered this issue before or have any advice on how to enable logging for both training and validation datasets, I would greatly appreciate your guidance.

Thank you so much for your time and help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [February 4, 2025, 12:39pm UTC](https://discuss.roboflow.com/t/sam2-1-fine-tuning-problem-for-validation/8245/2 "2025-02-04T12:39:30Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
