报错内容:
usage: train.py [-h] [--root_path ROOT_PATH] [--dataset DATASET]
[--list_dir LIST_DIR] [--num_classes NUM_CLASSES]
[--output_dir OUTPUT_DIR] [--max_iterations MAX_ITERATIONS]
[--max_epochs MAX_EPOCHS] [--batch_size BATCH_SIZE]
[--n_gpu N_GPU] [--deterministic DETERMINISTIC]
[--base_lr BASE_LR] [--img_size IMG_SIZE] [--seed SEED] --cfg
FILE [--opts OPTS [OPTS ...]] [--zip]
[--cache-mode {no,full,part}] [--resume RESUME]
[--accumulation-steps ACCUMULATION_STEPS] [--use-checkpoint]
[--amp-opt-level {O0,O1,O2}] [--tag TAG] [--eval]
[--throughput]
train.py: error: the following arguments are required: --cfg
解决方法:
parser.add_argument('--cfg', type=str,default='./configs/swin_tiny_patch4_window7_224_lite.yaml',metavar="FILE", help='path to config file', )
##config这里加了default,把required=ture删掉了
顺利解决