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

Traceback (most recent call last):
File "C:/Users/lijing/Desktop/Lee-LISRD/lisrd/experiment.py", line 120, in
with open(args.config, 'r') as f:
AttributeError: 'Namespace' object has no attribute 'config'

if name == "main":
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')

# Training command
p_train = subparsers.add_parser('train')
p_train.add_argument('--config', type=str)
p_train.add_argument('--exper_path', type=str,
                     help="Path to the directory of your experiment.")
p_train.add_argument('--resume_training_from', type=str, default='',
                     help="path to a checkpoint to resume training.")
p_train.set_defaults(func=_train)

# Testing command
p_test = subparsers.add_parser('test')
p_test.add_argument('--config', type=str)
p_test.add_argument('--exper_path', type=str,
                     help="Path to the directory of your experiment.")
p_test.add_argument('--checkpoint', type=str,
                     help="path to the checkpoint of the model.")
p_test.set_defaults(func=_test)

# Command to export the descriptors
p_export = subparsers.add_parser('export')
p_export.add_argument('--config', type=str)
p_export.add_argument('--exper_path', type=str,
                      help="Path to the directory of your experiment.")
p_export.add_argument('--checkpoint', type=str,
                      help="path to the checkpoint of the model.")
p_export.add_argument('--export_name', type=str,
                      help="Output directory name.")
p_export.set_defaults(func=_export)

args = parser.parse_args()
with open(args.config, 'r') as f:
    config = yaml.full_load(f)
exper_dir = os.path.expanduser(args.exper_path)
if not os.path.exists(exper_dir):
    os.mkdir(exper_dir)

你120行代码有错误,粘前35行想干啥
而且提示的很清楚了,args是个命名空间,你变量不要取这个名字,换个名字