提交 32bcda21 编写于 作者: J jiangjiajun

little notes modify

上级 1ebb5bbc
...@@ -47,10 +47,10 @@ def arg_parser(): ...@@ -47,10 +47,10 @@ def arg_parser():
def tf2paddle(model_path, save_dir): def tf2paddle(model_path, save_dir):
print("Now translating model from tensorflow to paddle.")
from x2paddle.decoder.tf_decoder import TFDecoder from x2paddle.decoder.tf_decoder import TFDecoder
from x2paddle.optimizer.tf_optimizer import TFGraphOptimizer 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) model = TFDecoder(model_path)
mapper = TFOpMapper(model) mapper = TFOpMapper(model)
mapper.run() mapper.run()
...@@ -58,9 +58,10 @@ def tf2paddle(model_path, save_dir): ...@@ -58,9 +58,10 @@ def tf2paddle(model_path, save_dir):
def caffe2paddle(proto, weight, 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.decoder.caffe_decoder import CaffeDecoder
from x2paddle.op_mapper.caffe_op_mapper import CaffeOpMapper from x2paddle.op_mapper.caffe_op_mapper import CaffeOpMapper
print("Now translating model from caffe to paddle.")
model = CaffeDecoder(proto, weight) model = CaffeDecoder(proto, weight)
mapper = CaffeOpMapper(model) mapper = CaffeOpMapper(model)
mapper.run() mapper.run()
...@@ -75,11 +76,11 @@ def main(): ...@@ -75,11 +76,11 @@ def main():
assert args.save_dir is not None, "--save_dir is not defined" assert args.save_dir is not None, "--save_dir is not defined"
if args.framework == "tensorflow": 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) tf2paddle(args.model, args.save_dir)
elif args.framework == "caffe": 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) caffe2paddle(args.proto, args.weight, args.save_dir)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册