提交 3b5bed68 编写于 作者: Y Yu Yang

Add dump binary config

上级 987a908f
...@@ -20,6 +20,7 @@ __all__ = [] ...@@ -20,6 +20,7 @@ __all__ = []
if __name__ == '__main__': if __name__ == '__main__':
whole_conf = False whole_conf = False
binary = False
if len(sys.argv) == 2: if len(sys.argv) == 2:
conf = parse_config(sys.argv[1], '') conf = parse_config(sys.argv[1], '')
elif len(sys.argv) == 3: elif len(sys.argv) == 3:
...@@ -28,6 +29,8 @@ if __name__ == '__main__': ...@@ -28,6 +29,8 @@ if __name__ == '__main__':
conf = parse_config(sys.argv[1], sys.argv[2]) conf = parse_config(sys.argv[1], sys.argv[2])
if sys.argv[3] == '--whole': if sys.argv[3] == '--whole':
whole_conf = True whole_conf = True
elif sys.argv[3] == '--binary':
binary = True
else: else:
raise RuntimeError() raise RuntimeError()
...@@ -35,5 +38,8 @@ if __name__ == '__main__': ...@@ -35,5 +38,8 @@ if __name__ == '__main__':
if whole_conf: if whole_conf:
print conf print conf
else:
if binary:
sys.stdout.write(conf.SerializeToString())
else: else:
print conf.model_config print conf.model_config
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册