嘉渊
2023-04-24 420849cfb3113c9e7475e5e72b3f8d7912fffe08
funasr/bin/train.py
@@ -77,6 +77,12 @@
        help="Whether to use the find_unused_parameters in "
             "torch.nn.parallel.DistributedDataParallel ",
    )
    parser.add_argument(
        "--gpu_id",
        type=int,
        default=0,
        help="local gpu id.",
    )
    # cudnn related
    parser.add_argument(
@@ -279,6 +285,17 @@
        default=[],
    )
    parser.add_argument(
        "--train_shape_file",
        type=str, action="append",
        default=[],
    )
    parser.add_argument(
        "--valid_shape_file",
        type=str,
        action="append",
        default=[],
    )
    parser.add_argument(
        "--use_preprocessor",
        type=str2bool,
        default=True,
@@ -399,6 +416,7 @@
    torch.backends.cudnn.deterministic = args.cudnn_deterministic
    # ddp init
    os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_id)
    args.distributed = args.dist_world_size > 1
    distributed_option = build_distributed(args)