Hi, there. I have this question that seems to be a bug, but I really don’t know if I’m messing things up, or I’m mistaken.
I want to use a custom params file to track all the hyperparameters of the model in the framework I’m using (detectron2’ config.yaml) . Just to be clear: I don’t want to use the standard-named “params.yaml”. I’ve already tried to rename the configuration file to params.yaml and it does work, but I’m not allowed to use that because of our project’s naming conventions.
Just to make things easier, I’m working with an example that I found on the internet that should work, just with an echo command.
$ dvc run -n hello "echo Hello"
It creates the following dvc.yaml:
stages:
hello:
cmd: echo Hello
I would like that it says hello to a value of a parameter defined inside a custom param file, for example:
custom.yaml
NAME: Lucas
Then, change the original dvc.yaml to the following:
stages:
hello:
params:
- custom.yaml:
cmd: echo Hello ${NAME}
When I run dvc repro, it gives me the following error message:
ERROR: failed to parse 'stages.hello.cmd' in 'dvc.yaml': Could not find 'NAME'
It turns out that if I rename custom.yaml to params.yaml, erasing (or not) the whole “params” section in the dvc.yaml, it works as expected, printing: " Hello Lucas".
My first intuition was that it wasn’t reading my custom.yaml at all. So I tried this third version of dvc.yaml:
stages:
hello:
params:
- custom.yaml:
cmd: echo Hello
Note that I erased the template part from the command, and I intentionally introduced a syntax error on custom.yaml, like this:
NAME: "Lucas
Then, dvc repro gives this error.
ERROR: failed to reproduce 'hello': Unable to read parameters from 'custom.yaml': unable to read: 'custom.yaml', YAML file structure is corrupted: ...
But if fix the syntax error, and restore the template part of the command, it goes back to the first error:
ERROR: failed to parse ‘stages.hello.cmd’ in ‘dvc.yaml’: Could not find ‘NAME’
So, it seems to parse the command first, and if there are no errors, then it tries to parse the custom.yaml … or I don’t know
Any help will be really appreciated.