History

libavfilter/dnn: add header into native model file

Guo, Yejun committed 7 years ago

Commit 022f50d1 parent 3b3150c3 files · +70 −2Browse files

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

Unified · Split

tools/python/convert_from_tensorflow.py+3−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 import tensorflow as tf
2121 import numpy as np
2222 import sys, struct
23+import convert_header as header
2324
2425 __all__ = ['convert_from_tensorflow']
2526
@@ -229,6 +230,8 @@ class TFConverter: · 203 unmodified lines
229230
230231 def dump_to_file(self):
231232 with open(self.outfile, 'wb') as f:
233+ f.write(header.str.encode('utf-8'))
234+ np.array([header.major, header.minor], dtype=np.uint32).tofile(f)
232235 self.dump_layers_to_file(f)
233236 self.dump_operands_to_file(f)
234237 np.array([self.layer_number, len(self.name_operand_dict)], dtype=np.uint32).tofile(f)

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