wayveai / mile

PyTorch code for the paper "Model-Based Imitation Learning for Urban Driving".
MIT License
365 stars 35 forks source link

Some issues during training #49

Open Syk-yr opened 3 months ago

Syk-yr commented 3 months ago

Thank you very much for providing the open-source program, but I encountered an issue during the first step of training. I run according to the training process of Readme.md, and the following errors appeared:

AttributeError 'Namespace' object has no attribute 'config'。

It happened in def main(): args = get_parser().parse_args() cfg = get_cfg(args) ---- some error


def get_cfg(args=None, cfg_dict=None): """First get default config. Then merge cfg_dict. Then merge according to args."""

cfg = _C.clone()

if cfg_dict is not None:
    extra_keys = _find_extra_keys(cfg, cfg_dict)
    if len(extra_keys) > 0:
        print(f"Warning - the cfg_dict merging into the main cfg has keys that do not exist in main: {extra_keys}")
        cfg.set_new_allowed(True)
    cfg.merge_from_other_cfg(CfgNode(cfg_dict))

if args is not None:
      if args.config:----------------------------some error

AttributeError 'Namespace' object has no attribute 'config'。

How can I solve this problem? Thank you very much!

adeebislam8 commented 4 weeks ago

In config.py replace the get_parser() with the following.

`def get_parser(): parser = argparse.ArgumentParser(description='World model training')

parser.add_argument('--config-file', default='', metavar='FILE', help='path to config file')

parser.add_argument('--config', default='mile/configs/debug.yml', metavar='FILE', help='path to config file')
parser.add_argument(
    'opts', help='Modify config options using the command-line', default=None, nargs=argparse.REMAINDER,
)
return parser`