From c1bc55389a0b3e867853f501dc71c8a8ba3a1e64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 18 Jun 2019 16:26:55 +0900 Subject: [PATCH] [tf2tflite] Add TF_IV3_MaxPool test (#3847) This commit adds TF_IV3_MaxPool test. Signed-off-by: Jonghyun Park --- contrib/tf2tflite/tests/TF_IV3_MaxPool/test.info | 2 + contrib/tf2tflite/tests/TF_IV3_MaxPool/test.pbtxt | 65 +++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 contrib/tf2tflite/tests/TF_IV3_MaxPool/test.info create mode 100644 contrib/tf2tflite/tests/TF_IV3_MaxPool/test.pbtxt diff --git a/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.info b/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.info new file mode 100644 index 0000000..059b21c --- /dev/null +++ b/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.info @@ -0,0 +1,2 @@ +input, placeholder:0, TF_FLOAT, [1, 7, 7, 1] +output, maxpool2d:0, TF_FLOAT, [1, 3, 3, 1] diff --git a/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.pbtxt b/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.pbtxt new file mode 100644 index 0000000..b1eadcc --- /dev/null +++ b/contrib/tf2tflite/tests/TF_IV3_MaxPool/test.pbtxt @@ -0,0 +1,65 @@ +# HOW TO GENERATE: +# +# import tensorflow as tf +# value = tf.placeholder(dtype=tf.float32, shape=[1, 7, 7, 1], name='placeholder') +# output = tf.nn.max_pool(value, [1, 3, 3, 1], [1, 2, 2, 1], 'VALID', name='maxpool2d') +# tf.get_default_graph().as_graph_def() +# +# NOTE 1. The output shape is 1x3x3x1 +# +# >>> tf.graph_util.tensor_shape_from_node_def_name(tf.get_default_graph(), 'maxpool2d') +# TensorShape([Dimension(1), Dimension(3), Dimension(3), Dimension(1)]) +# +# NOTE 2. All the MaxPool nodes in inception v3 2018.04.27 use this configuration. +# - InceptionV3/InceptionV3/MaxPool_3a_3x3/MaxPool +# - InceptionV3/InceptionV3/MaxPool_5a_3x3/MaxPool +# - InceptionV3/InceptionV3/Mixed_6a/Branch_2/MaxPool_1a_3x3/MaxPool +# - InceptionV3/InceptionV3/Mixed_7a/Branch_2/MaxPool_1a_3x3/MaxPool +node { + name: "placeholder" + op: "Placeholder" + attr { + key: "dtype" + value { type: DT_FLOAT } + } + attr { + key: "shape" + value { + shape { + dim { size: 1 } + dim { size: 7 } + dim { size: 7 } + dim { size: 1 } + } + } + } +} +node { + name: "maxpool2d" + op: "MaxPool" + input: "placeholder" + attr { + key: "T" + value { type: DT_FLOAT } + } + attr { + key: "data_format" + value { s: "NHWC" } + } + attr { + key: "ksize" + value { + list { i: 1 i: 3 i: 3 i: 1 } + } + } + attr { + key: "padding" + value { s: "VALID" } + } + attr { + key: "strides" + value { + list { i: 1 i: 2 i: 2 i: 1 } + } + } +} -- 2.7.4