Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
59d8ba8f
Commit
59d8ba8f
authored
Jun 14, 2019
by
Alexander Pivovarov
Committed by
Yao Wang
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test_forward_ssd_mobilenet_v1 to tflite/test_forward (#3350)
parent
8a89177b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
python/tvm/relay/testing/tf.py
+3
-6
tests/python/frontend/tflite/test_forward.py
+19
-0
No files found.
python/tvm/relay/testing/tf.py
View file @
59d8ba8f
...
...
@@ -163,13 +163,10 @@ def get_workload_official(model_url, model_sub_path):
model_sub_path:
Sub path in extracted tar for the ftozen protobuf file.
temp_dir: TempDirectory
The temporary directory object to download the content.
Returns
-------
graph_def: graphdef
graph_def is the tensorflow workload for mobilenet.
model_path: str
Full path to saved model file
"""
...
...
@@ -200,7 +197,7 @@ def get_workload(model_path, model_sub_path=None):
Returns
-------
graph_def: graphdef
graph_def is the tensorflow workload
for mobilenet
.
graph_def is the tensorflow workload.
"""
...
...
tests/python/frontend/tflite/test_forward.py
View file @
59d8ba8f
...
...
@@ -599,6 +599,24 @@ def test_forward_inception_v4_net():
rtol
=
1e-5
,
atol
=
1e-5
)
#######################################################################
# SSD Mobilenet
# -------------
def
test_forward_ssd_mobilenet_v1
():
"""Test the SSD Mobilenet V1 TF Lite model."""
# SSD MobilenetV1
tflite_model_file
=
tf_testing
.
get_workload_official
(
"https://raw.githubusercontent.com/dmlc/web-data/master/tensorflow/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28_nopp.tgz"
,
"ssd_mobilenet_v1_coco_2018_01_28_nopp.tflite"
)
with
open
(
tflite_model_file
,
"rb"
)
as
f
:
tflite_model_buf
=
f
.
read
()
data
=
np
.
random
.
uniform
(
size
=
(
1
,
300
,
300
,
3
))
.
astype
(
'float32'
)
tflite_output
=
run_tflite_graph
(
tflite_model_buf
,
data
)
tvm_output
=
run_tvm_graph
(
tflite_model_buf
,
data
,
'normalized_input_image_tensor'
)
tvm
.
testing
.
assert_allclose
(
np
.
squeeze
(
tvm_output
[
0
]),
np
.
squeeze
(
tflite_output
[
0
]),
rtol
=
1e-5
,
atol
=
1e-5
)
#######################################################################
# Main
# ----
if
__name__
==
'__main__'
:
...
...
@@ -623,3 +641,4 @@ if __name__ == '__main__':
test_forward_mobilenet_v2
()
test_forward_inception_v3_net
()
test_forward_inception_v4_net
()
test_forward_ssd_mobilenet_v1
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment