diff options
author | 김용섭/On-Device Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com> | 2019-04-19 17:38:44 +0900 |
---|---|---|
committer | 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com> | 2019-04-19 17:38:44 +0900 |
commit | ec76f7f9ec5842623df5d4f144b81af308ffe15e (patch) | |
tree | 97190adefa1f8dc9733eddb256ae252c31229eab /tools | |
parent | c5403134115c204720dc8bee846811b00e3fc9f7 (diff) | |
download | nnfw-ec76f7f9ec5842623df5d4f144b81af308ffe15e.tar.gz nnfw-ec76f7f9ec5842623df5d4f144b81af308ffe15e.tar.bz2 nnfw-ec76f7f9ec5842623df5d4f144b81af308ffe15e.zip |
Add printing info for filled memory in model_parser (#5028)
* Add printing info for filled memory in model_parser
Add printing info for filled memory such as weight in model_parser
Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
* fix failed format-check
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tflitefile_tool/model_printer.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/tflitefile_tool/model_printer.py b/tools/tflitefile_tool/model_printer.py index ad06fa7a7..fda029143 100644 --- a/tools/tflitefile_tool/model_printer.py +++ b/tools/tflitefile_tool/model_printer.py @@ -134,9 +134,12 @@ class ModelPrinter(object): def PrintTotalMemory(self): total_memory = 0 + filled_memory = 0 # only memory for constant for tensor in self.op_parser.GetAllTensors(): + if tensor.tf_buffer.DataLength() != 0: + filled_memory += tensor.memory_size total_memory += tensor.memory_size from tensor_printer import ConvertBytesToHuman - print("Expected total memory for allocating all tensors: {0}".format( - ConvertBytesToHuman(total_memory))) + print("Expected TOTAL memory: {0}".format(ConvertBytesToHuman(total_memory))) + print("Expected FILLED memory: {0}".format(ConvertBytesToHuman(filled_memory))) |