Wrong conversion of default args leads to errors in Pytorch Lightning

I looked into this and you need to use the arg-switch feature of guild.

Create a guild.yaml file like this:

- model: auto_encoder
  source-code: "*.py"
  operations:
    train:
      main: main
      flags:
        deterministic:
          arg-switch: yes

You can now run

guild run auto_encoder:train deterministic=yes
guild run auto_encoder:train deterministic=no

And it should be parsed correctly by pytorch-lightning.

Note you don’t have to specify all hyperparameters in your guild file since you can use --force-flags:

guild run auto_encoder:train deterministic=yes gradient_clip_val=0.1 --force-flags

I am not sure if you can do arg-switch from the CLI without specifying a guild.yaml file. Maybe @garrett knows.

1 Like