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
fc2b2a07
Commit
fc2b2a07
authored
Jun 01, 2019
by
Alexander Pivovarov
Committed by
Yao Wang
Jun 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tflite tutorial to use TFLite r1.13 schema (#3271)
parent
887255a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
tutorials/frontend/from_tflite.py
+4
-6
No files found.
tutorials/frontend/from_tflite.py
View file @
fc2b2a07
...
@@ -52,7 +52,7 @@ or you could generate TFLite package by yourself. The steps are as following:
...
@@ -52,7 +52,7 @@ or you could generate TFLite package by yourself. The steps are as following:
flatc --version
flatc --version
# Get the TFLite schema.
# Get the TFLite schema.
wget https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1
2/tensorflow/contrib
/lite/schema/schema.fbs
wget https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1
3/tensorflow
/lite/schema/schema.fbs
# Generate TFLite package.
# Generate TFLite package.
flatc --python schema.fbs
flatc --python schema.fbs
...
@@ -144,7 +144,7 @@ func, params = relay.frontend.from_tflite(tflite_model,
...
@@ -144,7 +144,7 @@ func, params = relay.frontend.from_tflite(tflite_model,
# target x86 CPU
# target x86 CPU
target
=
"llvm"
target
=
"llvm"
with
relay
.
transform
.
build_config
(
opt_level
=
3
):
with
relay
.
build_config
(
opt_level
=
3
):
graph
,
lib
,
params
=
relay
.
build
(
func
,
target
,
params
=
params
)
graph
,
lib
,
params
=
relay
.
build
(
func
,
target
,
params
=
params
)
######################################################################
######################################################################
...
@@ -180,11 +180,9 @@ label_file_url = ''.join(['https://raw.githubusercontent.com/',
...
@@ -180,11 +180,9 @@ label_file_url = ''.join(['https://raw.githubusercontent.com/',
label_file
=
"labels_mobilenet_quant_v1_224.txt"
label_file
=
"labels_mobilenet_quant_v1_224.txt"
label_path
=
download_testdata
(
label_file_url
,
label_file
,
module
=
'data'
)
label_path
=
download_testdata
(
label_file_url
,
label_file
,
module
=
'data'
)
# map id to 1001 classes
# list of 1001 classes
labels
=
dict
()
with
open
(
label_path
)
as
f
:
with
open
(
label_path
)
as
f
:
for
id
,
line
in
enumerate
(
f
):
labels
=
f
.
readlines
()
labels
[
id
]
=
line
# convert result to 1D data
# convert result to 1D data
predictions
=
np
.
squeeze
(
tvm_output
)
predictions
=
np
.
squeeze
(
tvm_output
)
...
...
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