History

convert_from_tensorflow.py: add option to dump graph for visualization in tensorboard

Guo, Yejun committed 7 years ago

Commit 2c014341 parent aac382e2 files · +12 −7Browse files

Showing the changes to tools/python/convert.py (1 of 2 files). Show all

Unified · Split

tools/python/convert.py+5−1
@@ -27,6 +27,7 @@ def get_arguments(): · 26 unmodified lines
2727 parser.add_argument('--outdir', type=str, default='./', help='where to put generated files')
2828 parser.add_argument('--infmt', type=str, default='tensorflow', help='format of the deep learning model')
2929 parser.add_argument('infile', help='path to the deep learning model with weights')
30+ parser.add_argument('--dump4tb', type=str, default='no', help='dump file for visualization in tensorboard')
3031
3132 return parser.parse_args()
3233
@@ -44,9 +45,12 @@ def main(): · 11 unmodified lines
4445 basefile = os.path.split(args.infile)[1]
4546 basefile = os.path.splitext(basefile)[0]
4647 outfile = os.path.join(args.outdir, basefile) + '.model'
48+ dump4tb = False
49+ if args.dump4tb.lower() in ('yes', 'true', 't', 'y', '1'):
50+ dump4tb = True
4751
4852 if args.infmt == 'tensorflow':
49− convert_from_tensorflow(args.infile, outfile)
53+ convert_from_tensorflow(args.infile, outfile, dump4tb)
5054
5155 if __name__ == '__main__':
5256 main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t