Skip to content

How to export user-defined metadata of experiment during training #7888

Closed Answered by KevinMusgrave
DaanS8 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use a PyTorchCallback to save arbitrary data to the checkpoint directory:

import torch
import pathlib
from determined.pytorch import PyTorchCallback, PyTorchTrial

class DeterminedMain(PyTorchTrial):
    def __init__(self, context):
        self.train_indices = ...
        self.val_indices = ...

    def build_callbacks(self) -> Dict[str, PyTorchCallback]:
        return {"save_indices_callback": SaveIndicesCallback(self.train_indices, self.val_indices)}


class SaveIndicesCallback(PyTorchCallback):
    def __init__(self, train_indices, val_indices) -> None:
        self.train_indices = train_indices
        self.val_indices = val_indices
        super().__init__()

    def on_che…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DaanS8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants