parser.add_argument()已经设置了默认值,但调试时仍然报错:main.py: error: the following arguments are required: data

报错的代码:
parser.add_argument('data', type=str, default='/home/user1/datasets/cifar10', help='path to dataset')
在data前加"--",修改后的代码:
parser.add_argument('--data', type=str, default='/home/user1/datasets/cifar10', help='path to dataset')

posted @ 2023-05-26 15:33  Kurie  阅读(438)  评论(0编辑  收藏  举报