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
bfa966a8
Commit
bfa966a8
authored
Jun 10, 2019
by
Alexander Pivovarov
Committed by
Tianqi Chen
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Error messages in tflite.py (#3320)
parent
45ef90c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
nnvm/python/nnvm/frontend/keras.py
+0
-1
python/tvm/relay/frontend/keras.py
+0
-1
python/tvm/relay/frontend/tflite.py
+5
-4
tests/python/frontend/keras/test_forward.py
+1
-1
No files found.
nnvm/python/nnvm/frontend/keras.py
View file @
bfa966a8
...
...
@@ -180,7 +180,6 @@ def _convert_convolution(insym, keras_layer, symtab):
else
:
kernel_h
,
kernel_w
,
in_channels
,
n_filters
=
weightList
[
0
]
.
shape
weight
=
weightList
[
0
]
.
transpose
([
3
,
2
,
0
,
1
])
dilation
=
[
1
,
1
]
if
isinstance
(
keras_layer
.
dilation_rate
,
(
list
,
tuple
)):
dilation
=
[
keras_layer
.
dilation_rate
[
0
],
keras_layer
.
dilation_rate
[
1
]]
else
:
...
...
python/tvm/relay/frontend/keras.py
View file @
bfa966a8
...
...
@@ -203,7 +203,6 @@ def _convert_convolution(inexpr, keras_layer, etab):
else
:
kernel_h
,
kernel_w
,
in_channels
,
n_filters
=
weightList
[
0
]
.
shape
weight
=
weightList
[
0
]
.
transpose
([
3
,
2
,
0
,
1
])
dilation
=
[
1
,
1
]
if
isinstance
(
keras_layer
.
dilation_rate
,
(
list
,
tuple
)):
dilation
=
[
keras_layer
.
dilation_rate
[
0
],
keras_layer
.
dilation_rate
[
1
]]
else
:
...
...
python/tvm/relay/frontend/tflite.py
View file @
bfa966a8
...
...
@@ -156,7 +156,7 @@ class OperatorConverter(object):
if
tensor_wrapper
.
tensor
.
Type
()
==
TensorType
.
INT32
:
return
np
.
frombuffer
(
tensor_wrapper
.
buffer
.
DataAsNumpy
(),
dtype
=
np
.
int32
)
.
reshape
(
tensor_wrapper
.
tensor
.
ShapeAsNumpy
())
raise
NotImplementedError
(
"
Not support tensor type {}
"
raise
NotImplementedError
(
"
Tensor type {} is currently not supported
"
.
format
(
str
(
tensor_wrapper
.
tensor
.
Type
())))
def
get_tensor_type_str
(
self
,
tensor_type
):
...
...
@@ -172,7 +172,8 @@ class OperatorConverter(object):
return
"float32"
if
tensor_type
==
TensorType
.
INT32
:
return
"int32"
raise
NotImplementedError
(
"Not support tensor type {}"
.
format
(
str
(
tensor_type
)))
raise
NotImplementedError
(
"Tensor type {} is currently not supported"
.
format
(
str
(
tensor_type
)))
def
convert_conv2d
(
self
,
op
):
"""Convert TFLite conv2d"""
...
...
@@ -450,8 +451,8 @@ class OperatorConverter(object):
conv_options
=
DepthwiseConv2DOptions
()
conv_options
.
Init
(
op_options
.
Bytes
,
op_options
.
Pos
)
depth_multiplier
=
conv_options
.
DepthMultiplier
()
assert
depth_multiplier
==
1
,
"TF frontend
have transformed it be 1
"
\
"
no matter original value be set by 0.25, 0.5 or any
else"
assert
depth_multiplier
==
1
,
"TF frontend
transforms it to be 1 regardless of what
"
\
"
original value is set to 0.25, 0.5 or anything
else"
else
:
raise
tvm
.
error
.
OpNotImplemented
(
'Operator {} is not supported for frontend TFLite.'
.
format
(
conv_type
))
...
...
tests/python/frontend/keras/test_forward.py
View file @
bfa966a8
...
...
@@ -21,7 +21,7 @@ from tvm.contrib import graph_runtime
from
tvm.relay.testing.config
import
ctx_list
import
keras
# prevent
k
eras from using up all gpu memory
# prevent
K
eras from using up all gpu memory
import
tensorflow
as
tf
from
keras.backend.tensorflow_backend
import
set_session
config
=
tf
.
ConfigProto
()
...
...
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