From 32bcda2162fb8dfb5154559ea5fd0b9828bfcea8 Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Fri, 19 Jul 2019 13:47:11 +0800 Subject: [PATCH] little notes modify --- x2paddle/convert.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/x2paddle/convert.py b/x2paddle/convert.py index cc32f52..8f634a9 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -47,10 +47,10 @@ def arg_parser(): def tf2paddle(model_path, save_dir): - print("Now translating model from tensorflow to paddle.") from x2paddle.decoder.tf_decoder import TFDecoder from x2paddle.optimizer.tf_optimizer import TFGraphOptimizer - from x2paddle.op_mapper.tf_op_mapper import TFOpMapper + + print("Now translating model from tensorflow to paddle.") model = TFDecoder(model_path) mapper = TFOpMapper(model) mapper.run() @@ -58,9 +58,10 @@ def tf2paddle(model_path, save_dir): def caffe2paddle(proto, weight, save_dir): - print("Now translating model from caffe to paddle.") from x2paddle.decoder.caffe_decoder import CaffeDecoder from x2paddle.op_mapper.caffe_op_mapper import CaffeOpMapper + + print("Now translating model from caffe to paddle.") model = CaffeDecoder(proto, weight) mapper = CaffeOpMapper(model) mapper.run() @@ -75,11 +76,11 @@ def main(): assert args.save_dir is not None, "--save_dir is not defined" if args.framework == "tensorflow": - assert args.model is not None, "--model should be defined while translate tensorflow model" + assert args.model is not None, "--model should be defined while translating tensorflow model" tf2paddle(args.model, args.save_dir) elif args.framework == "caffe": - assert args.proto is not None, "--proto and --weight should be defined while translate caffe model" + assert args.proto is not None, "--proto and --weight should be defined while translating caffe model" caffe2paddle(args.proto, args.weight, args.save_dir) else: -- GitLab