diff --git a/fluid/PaddleCV/deeplabv3+/train.py b/fluid/PaddleCV/deeplabv3+/train.py index a95fb12e4eee6c53a1046f067051f15c0d2dae6b..e009f76e0e16be9e4a5db532615cefac258fada1 100755 --- a/fluid/PaddleCV/deeplabv3+/train.py +++ b/fluid/PaddleCV/deeplabv3+/train.py @@ -34,7 +34,10 @@ def add_arguments(): add_argument('parallel', bool, False, "using ParallelExecutor.") add_argument('use_gpu', bool, True, "Whether use GPU or CPU.") add_argument('num_classes', int, 19, "Number of classes.") - parser.add_argument('--enable_ce', action='store_true', help='If set, run the task with continuous evaluation logs.') + parser.add_argument( + '--enable_ce', + action='store_true', + help='If set, run the task with continuous evaluation logs.') def load_model(): @@ -52,7 +55,10 @@ def load_model(): else: if args.num_classes == 19: fluid.io.load_params( - exe, dirname=args.init_weights_path, main_program=tp) + exe, + dirname="", + filename=args.init_weights_path, + main_program=tp) else: fluid.io.load_vars( exe, dirname="", filename=args.init_weights_path, vars=myvars) @@ -93,6 +99,7 @@ def get_cards(args): else: return args.num_devices + CityscapeDataset = reader.CityscapeDataset parser = argparse.ArgumentParser() @@ -202,9 +209,8 @@ for i, imgs, labels, names in batches: if args.enable_ce: gpu_num = get_cards(args) print("kpis\teach_pass_duration_card%s\t%s" % - (gpu_num, total_time / epoch_idx)) - print("kpis\ttrain_loss_card%s\t%s" % - (gpu_num, train_loss)) + (gpu_num, total_time / epoch_idx)) + print("kpis\ttrain_loss_card%s\t%s" % (gpu_num, train_loss)) print("Training done. Model is saved to", args.save_weights_path) save_model()