dvc icon indicating copy to clipboard operation
dvc copied to clipboard

dvc exp run --queue needs absolute path

Open walternat1ve opened this issue 2 years ago • 7 comments

dvc exp run --queue ... needs absolute path for the file in the command, otherwise queued experiments will fail because they cannot find the file from the command (if relative). while dvc exp run works also with relative path

maybe i missed it but this was nowhere documented imo and tbh it's a bit inconsistent.

walternat1ve avatar Dec 29 '22 15:12 walternat1ve

Are you referring to file arguments passed to commands in your dvc.yaml stages?

Using exp run --queue or exp run --temp runs your experiment in a temporary directory separate from your main repo workspace. If the files are in your repo and are tracked by git or DVC, relative paths will still work, since those files are all included in the temporary workspace. But as you noted, if your command takes a path to a file that is not tracked at all in your repo, you will need to use the absolute path to that file.

pmrowla avatar Dec 30 '22 01:12 pmrowla

you are right, the file was not tracked. now it works. thx for clearing that up. however, when creating a queue of 3 experiments with varying parameters, they all had the same name. thus resulted in only 1 exp when using "dvc exp show". i thought each one would get a unique name automatically.

walternat1ve avatar Dec 30 '22 08:12 walternat1ve

@walternat1ve Could you please elaborate it? You dvc.yaml file? And the dvc exp run command.

karajan1001 avatar Jan 18 '23 11:01 karajan1001

all good. the problem was that i changed the params for each queued experiment but didnt provide them as a dependency in dvc.yaml, therefore they were not treated as new experiments but rather i got the cached result and thus the same name. now it makes sense to me. thx for coming back to this issue.

walternat1ve avatar Jan 18 '23 12:01 walternat1ve

what can i do when a script or file is in a submodule which is tracked by git? it doesn't copy the content to tmp unfortunately

walternat1ve avatar Oct 17 '23 10:10 walternat1ve

submodules arent currently supported (https://github.com/iterative/dvc/issues/7186, https://github.com/iterative/dvc/issues/5855) but you should be able to use -C/--copy-paths to copy the specify files you need into the tempdir

pmrowla avatar Oct 17 '23 10:10 pmrowla

thx for the quick reply, i will try this workaround.

edit: @pmrowla i was not able to apply the workaround. i tried adding the full directory of submodule but it said its already there (as far as i can tell the directory was there but not the content). it's probably not feasible to specify each single file. what do you think is the best way?

walternat1ve avatar Oct 17 '23 10:10 walternat1ve