danijar / dreamerv2

Mastering Atari with Discrete World Models

Home Page:https://danijar.com/dreamerv2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError and AttributeError dreamerv2 in jupyter-notebook

balloch opened this issue · comments

Hi! I am trying to run the minigrid and crafter examples in a Jupyter notebook, but i keep getting this error when running the config.

Command (minigrid):

config = dv2.defaults.update({
    'logdir': '~/logdir/crafter',
    'log_every': 1e3,
    'train_every': 10,
    'prefill': 1e5,
    'actor_ent': 3e-3,
    'loss_scales.kl': 1.0,
    'discount': 0.99,
}).parse_flags()

Assertion Error:

~/miniconda3/envs/hacking/lib/python3.8/site-packages/dreamerv2/common/flags.py in parse(self, argv, known_only, help_exists)
     45         if flag.startswith('--'):
     46           raise ValueError(f"Flag '{flag}' did not match any config keys.")
---> 47       assert not remaining, remaining
     48       return parsed
     49 

AssertionError: ['-f', '/home/balloch/.local/share/jupyter/runtime/kernel-244efe8b-5d51-499b-bfa2-7611c02c8e5b.json']

Command (crafter)

config = dv2.defaults.update().parse_flags()

Attribute Error:

AttributeError: 'dict' object has no attribute 'crafter'

Hey, try removing the .parse_flags() because you probably don't want to parse command line flags when you run in colab.