Skip to content

Tensorboard logger logs to same directory when trial is pruned using hp_search and optuna #16535

@fschlatt

Description

@fschlatt

Environment info

  • transformers version: 4.11.3
  • Platform: Linux
  • Python version: 3.8.8

Who can help

@sgugger

Information

I am running a hyperparameter search on various models using optuna on a modified GLUE task. Whenever optuna prunes a trial, the following trial is logged into the same logging directory and therefore doesn't show up in Tensorboard. As far as I can tell, the immediate easy fix would be to call the on_train_end callback when the trial is to be pruned. This would reset the tensorboard logger and has worked for me in testing. I'm not sure if it has any unwanted side effects, though. I've opened a Pull Request fixing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions