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

UnparsedFlagAccessError when calling env.reset() #3

Closed
zhenbangt opened this issue Nov 9, 2021 · 2 comments
Closed

UnparsedFlagAccessError when calling env.reset() #3

zhenbangt opened this issue Nov 9, 2021 · 2 comments

Comments

@zhenbangt
Copy link

zhenbangt commented Nov 9, 2021

Hi,

I keep getting this weird error when calling env.reset(). I only get this error when running a Jupyter notebook

~/miniconda3/lib/python3.9/site-packages/dm_robotics/agentflow/spec_utils.py in debugging_flag() 45 46 def debugging_flag() -> bool: ---> 47 return FLAGS.debug_specs 48 49

Error Message:
UnparsedFlagAccessError: Trying to access flag --debug_specs before flags were parsed.

Defining the absl flag by myself does not help:
DuplicateFlagError: The flag 'debug_specs' is defined twice. First from dm_robotics.agentflow.spec_utils, Second from /home/ztan/miniconda3/lib/python3.9/site-packages/ipykernel_launcher.py. Description from first occurrence: Debugging switch for checking values match specs.

Any ideas why this keeps happening?
Thanks a lot

@shacklestone
Copy link
Collaborator

shacklestone commented Nov 26, 2021

Hi, what is in your function that runs when __name__ == "__main__ "?

It's important to have this kind of structure:

from absl import app

def main(argv):
  ...

if __name__ == '__main__':
  app.run(main)

See also the abseil/Flags docs

@shacklestone
Copy link
Collaborator

Is this issue resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants