dvclive
dvclive copied to clipboard
`dvc`: Enable model loading/saving based on `checkpoint: true`
Given a DVC stage where checkpoints are enabled:
stages:
train:
cmd: src/train.py
deps:
- data
- src
outs:
- model.pth:
checkpoint: true
live:
dvclive:
summary: true
html: true
Users need to also remember enabling checkpoints on the stage code.
Maybe we could treat the model_file argument of the integrations similar to how we treat the path argument:
A) If checkpoint: true is set in DVC and model_file is None in DVCLive: we use the value of the output as model_file .
B) If checkpoint: true is set in DVC and model_file is set in DVCLive but does not match: raise ConfigMismatchError.
C) If checkpoint: false, just use whichever value has model_file in DVCLive.
@pared @dberenbaum
A) If
checkpoint: trueis set in DVC andmodel_fileis None in DVCLive: we use the value of the output asmodel_file.
What do you mean by "we use the value of the output as model_file"? Does that mean infer model.pth here?
A) If
checkpoint: trueis set in DVC andmodel_fileis None in DVCLive: we use the value of the output asmodel_file.What do you mean by "we use the value of the output as
model_file"? Does that mean infermodel.pthhere?
Yes. Make DVC store the output path in an env var, like it does for DVCLIVE_PATH
@daavoo That would work only in integrations, right?
@daavoo That would work only in integrations, right?
With the current implementation, yes.
It makes sense to me.
It still seems slightly awkward to have to define the path in dvc.yaml. It would be great if this wasn't needed at all, and the model file was part of the live output by default, but that may be a separate issue.