Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter type defaults to string in experiment window #1235

Open
CourchesneA opened this issue Mar 22, 2024 · 2 comments
Open

Parameter type defaults to string in experiment window #1235

CourchesneA opened this issue Mar 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@CourchesneA
Copy link

Describe the bug

Using the clearml dashboard, I can clone and enqueue experiments with different parameters. When a parameters is null for the base experiments, it does not get assigned a type. If I try to clone and change that parameters, it will default to a string and might not be able to be parsed if another type is expected by argparse / jsonargparse.

I tested with a list type, and got the following error from jsonargparse:

ValueError: Does not validate against any of the Union subtypes
Subtypes: (<class 'list'>, <class 'NoneType'>)
Errors:
  - Expected a <class 'list'>
  - Expected a <class 'NoneType'>
Given value type: <class 'str'>
Given value: [600, 500]

In this scenario, I would have liked that config field to be parsed as a list of int, but it was passed as a string and resulted in an error. If I clone an experiment for which this parameter is non-null, it already has the type "list/int" and works fine

To reproduce

From a Pytorch Lightning or jsonargparse experiment, create an experiment with a list parameter and run it. Then, clone the experiment, and assign this parameter a non-empty value from the dashboard, and enqueue this experiment.

Expected behaviour

The config file should be parsed in the proper type. For example, if jsonargparse is expecting a list for the param and a value of "[1,2] is supplied, it should not be passed as a string and crash the program

Environment

  • Server type app.clear.ml
@CourchesneA CourchesneA added the bug Something isn't working label Mar 22, 2024
@ainoam
Copy link
Collaborator

ainoam commented Mar 24, 2024

@CourchesneA How is the parameter initially set with a NULL value (before you try to modify it)?

@CourchesneA
Copy link
Author

Using a YAML config file, initially generated with the --print_config flag (i.e. python trainer.py fit --print_config), most parameters are set to null:

min_steps: null

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants