You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would consider this a bug. The behavior of a class instance type hint, when overriding a single init arg of the class, is only to change that arg and keep all other init_args as before. But this seems to not be working for callables that return a class instance. The behavior must be consistent for these two cases.
Note that in #460 there is a request to always reset to defaults. If this gets implemented still the default behavior should be the overriding that you want.
Initially I had though that overriding of arguments was not working correctly for all callable types that return a class. However, after another look I noticed that without the list, i.e. scheduler: LRSchedulerCallable, the overriding works correctly. Thus, the issue is only when the type is nested. Unfortunately this might mean it is more difficult to fix.
Another comment unrelated to the bug. In the reproduction code the default for schedulers is invalid because it is not a list of callables.
The main bug should be fixed with #603. But note what I mentioned before, in the code above the default is wrong. The type expects a list, and the default isn't a list. The default could be changed into a list to make it agree with the type, but that kind of default is currently not supported.
This is a minimal reproduction. If I have this Python code which implements
jsonargparse.ArgumentParser
, and this YAML configuration file for it.
What I want to is to override the
monitor
value ofReduceLROnPlateau
without changing the other configuration values in the YAML file. For example,python test.py --config test.yaml --model.schedulers.monitor val/mAP50 --print_config
The expect output I want is
However, what I got is
The other values of
ReduceLROnPlateau
are reset to its default, not ones in the configuration file.Is there any method to allow this kind of overriding?
The text was updated successfully, but these errors were encountered: