Pytorch Lightning logs separately for train, validation and test datasets - Stack Overflow

I am trying to log the loss and auc for all 3 of my datasets - train, validation and test.The datamodu

I am trying to log the loss and auc for all 3 of my datasets - train, validation and test. The datamodule defines the 3 loaders and I finally invoke the model as:

trainer.fit(model,datamodule)
trainer.test(model,datamodule)

This ends up creating 2 different log files - 1 with train and validation metrics, and 1 with test metrics. Is there a way to collect these together? Context is that I am using the mlflow logger and would like to see all 3 sets of metrics on the same chart, but because of this behavior, it posts 2 different sets of metrics with the same run id, creating 2 different graphs.

I am trying to log the loss and auc for all 3 of my datasets - train, validation and test. The datamodule defines the 3 loaders and I finally invoke the model as:

trainer.fit(model,datamodule)
trainer.test(model,datamodule)

This ends up creating 2 different log files - 1 with train and validation metrics, and 1 with test metrics. Is there a way to collect these together? Context is that I am using the mlflow logger and would like to see all 3 sets of metrics on the same chart, but because of this behavior, it posts 2 different sets of metrics with the same run id, creating 2 different graphs.

Share Improve this question edited Mar 12 at 9:41 Matt Pitkin 6,6451 gold badge25 silver badges45 bronze badges asked Mar 11 at 19:54 ApurvaApurva 1732 silver badges8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It looks like lightning creates a different runid for each invocation. However, if I noticed if I start a run (in my case by logging hyperparameters):

mlflow_logger = MLFlowLogger(
    experiment_name=MLFLOW_EXPERIMENT_NAME,
    tracking_uri=MLFLOW_TRACKING_URI,
    run_name=MLFLOW_RUN_NAME,
)
mlflow_logger.log_hyperparams(hyperparams)

then lightning reuses the same runId for emitting metrics for fit and test stages.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744773968a4592933.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信