-
Notifications
You must be signed in to change notification settings - Fork 383
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
Error when using absl flags with sacred #855
Comments
@kirtanp
According to the Doc, you can update predefined configs by an extra config file as follow
or directly provide new values
Command-line inputs of scripts running with sacred(i.e., |
Hello @kirtanp and a happy new year! I'll add to @Jarvis73's answer: You can define command-line flags in sacred if you really need to. But for loading config files I would recommend the already mentioned |
Thanks @Jarvis73 and @thequilo ! To explain a bit more, the reason I was doing this was that I am using SEML, which builds on top of Sacred but uses a different way of getting the config params. However, when I run the script locally I just want to use Sacred and add the params through a yaml file, which is just a single line change in the script. I just wanted a global flag which would define whether I want to make this single line change in a sacred script of not. I thought that it would not make sense to have 'local' as part of sacred config or decorated by ex.config because the sacred config is not globally accessible. That is, I can only access the sacred config inside a function decorated by ex.config (and in this case I can't do ex.add_config("config.yaml") inside a function decorated by ex.config) or within the automain. And it wasn't clear that the config could be updated from within the automain. So a global flag sitting outside the sacred config seems like the cleanest solution. I feel like there could also be other applications where it would be useful to have a globally available 'meta-config' which does not store any parameters for the experiment but for how the script should run, and it doesn't seem to be possible easily. In any case, for me the solution with |
It'd be nicer if sacred could be dropped-in without modifying too much code. I'm working on top of a repo which extensively uses argparse... |
I am trying to use an absl flag flag in a sacred script. Here is a minimal example
My use case is that I want a global flag that can be passed to the python script to decide whether to read config from the yaml file or not.
The issue is that when I call the script
python3 script.py --local=True
. I get the errorI got the same error when I tried to use argparse instead of absl, and looking at this (slightly related) issue #709, it seems to be caused by
post_process_name
and/orjoin_paths
. I don't know if this is a bug or expected behaviour, but in any case my questions is: Is it possible to use a global absl or argparse flag along with sacred?The text was updated successfully, but these errors were encountered: