summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-07-15 10:25:01 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2019-07-15 10:25:01 +0900
commite2dba8cffe7f3d81c095a50772cd6606f7dd113c (patch)
tree7200bb25fe8d8ec6bdf0b39765887490e7b87d20 /tools
parentd7501af22a4b089df721b27a9d34c0134aa1db51 (diff)
downloadnnfw-e2dba8cffe7f3d81c095a50772cd6606f7dd113c.tar.gz
nnfw-e2dba8cffe7f3d81c095a50772cd6606f7dd113c.tar.bz2
nnfw-e2dba8cffe7f3d81c095a50772cd6606f7dd113c.zip
Fix pylint warning in weight extract tool (#5629)
Fix pylint warning for print syntax in weight extract tool Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/extract_weights_from_tflite/extract.py13
-rwxr-xr-xtools/extract_weights_from_tflite/print_op.py10
2 files changed, 12 insertions, 11 deletions
diff --git a/tools/extract_weights_from_tflite/extract.py b/tools/extract_weights_from_tflite/extract.py
index afde08c69..7559ba7e8 100755
--- a/tools/extract_weights_from_tflite/extract.py
+++ b/tools/extract_weights_from_tflite/extract.py
@@ -41,9 +41,9 @@ buffer_name_map = {}
for t in tensors:
if 'buffer' in t:
if t['buffer'] in buffer_name_map:
- print 'find conflict!!'
- print t
- print buffer_name_map
+ print('find conflict!!')
+ print(t)
+ print(buffer_name_map)
comps = t['name'].split('/')
names = []
if len(comps) > 1 and comps[0] == comps[1]:
@@ -60,7 +60,8 @@ for i in range(len(j['buffers'])):
b = j['buffers'][i]
if 'data' in b:
if i not in buffer_name_map:
- print "buffer %d is not found in buffer_name_map. skip printing the buffer..."
+ print("buffer %d is not found in buffer_name_map. skip printing the buffer..."
+ % i)
continue
filename = "%s.npy" % (buffer_name_map[i]['name'])
@@ -83,8 +84,8 @@ for i in range(len(j['buffers'])):
elif len(shape) == 1:
pass
else:
- print "Undefined length: conversion skipped. shape=", shape
+ print("Undefined length: conversion skipped. shape=", shape)
#print shape, filename, n.shape
np.save(filename, n)
-print "Done."
+print("Done.")
diff --git a/tools/extract_weights_from_tflite/print_op.py b/tools/extract_weights_from_tflite/print_op.py
index 16aff9720..a946b926c 100755
--- a/tools/extract_weights_from_tflite/print_op.py
+++ b/tools/extract_weights_from_tflite/print_op.py
@@ -48,11 +48,11 @@ for o in operators:
elif 'builtin_options_type' in o:
# if we cannot find opcode_index, print option type instead.
op_name = o['builtin_options_type']
- print "Layer:", op_name
+ print("Layer:", op_name)
- print " Input shapes ---"
+ print(" Input shapes ---")
for inp in o['inputs']:
- print " ", tensors[inp]['shape']
- print " Output shapes ---"
+ print(" ", tensors[inp]['shape'])
+ print(" Output shapes ---")
for outp in o['outputs']:
- print " ", tensors[outp]['shape']
+ print(" ", tensors[outp]['shape'])