From 1b2ca6e641fb8c5e2ac5171f38fb5f37cbdee785 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Mon, 30 Aug 2021 06:37:26 +0000 Subject: [PATCH] polish code --- ppocr/modeling/transforms/tps.py | 2 -- tools/program.py | 4 ---- tools/train.py | 2 -- 3 files changed, 8 deletions(-) diff --git a/ppocr/modeling/transforms/tps.py b/ppocr/modeling/transforms/tps.py index de4bb7a6..81221b03 100644 --- a/ppocr/modeling/transforms/tps.py +++ b/ppocr/modeling/transforms/tps.py @@ -326,6 +326,4 @@ class STN_ON(nn.Layer): image, self.tps_inputsize, mode="bilinear", align_corners=True) stn_img_feat, ctrl_points = self.stn_head(stn_input) x, _ = self.tps(image, ctrl_points) - #print("x:", np.sum(x.numpy())) - # print(x.shape) return x diff --git a/tools/program.py b/tools/program.py index 3479ff26..f77c69f8 100755 --- a/tools/program.py +++ b/tools/program.py @@ -215,9 +215,6 @@ def train(config, preds = model(images, data=batch[1:]) else: preds = model(images) - state_dict = model.state_dict() - # for key in state_dict: - # print(key) loss = loss_class(preds, batch) avg_loss = loss['loss'] avg_loss.backward() @@ -414,7 +411,6 @@ def preprocess(is_train=False): yaml.dump( dict(config), f, default_flow_style=False, sort_keys=False) log_file = '{}/train.log'.format(save_model_dir) - print("log has save in {}/train.log".format(save_model_dir)) else: log_file = None logger = get_logger(name='root', log_file=log_file) diff --git a/tools/train.py b/tools/train.py index e1515f57..20f5a670 100755 --- a/tools/train.py +++ b/tools/train.py @@ -72,8 +72,6 @@ def main(config, device, logger, vdl_writer): # for rec algorithm if hasattr(post_process_class, 'character'): char_num = len(getattr(post_process_class, 'character')) - character = getattr(post_process_class, 'character') - print("getattr character:", character) if config['Architecture']["algorithm"] in ["Distillation", ]: # distillation model for key in config['Architecture']["Models"]: -- GitLab