Skip to content

Add RESIZE operators to Realy TFLite frontend - #3370

Merged
kevinthesun merged 1 commit into
apache:masterfrom
apivovarov:tf
Jun 18, 2019
Merged

Add RESIZE operators to Realy TFLite frontend#3370
kevinthesun merged 1 commit into
apache:masterfrom
apivovarov:tf

Conversation

@apivovarov

Copy link
Copy Markdown
Contributor

Add RESIZE operators to Realy TFLite frontend

Request to support RESIZE_BILLINEAR operators comes from #3189

@apivovarov

Copy link
Copy Markdown
ContributorAuthor

@FrozenGene@yongwww Could you have a look?

Comment threadpython/tvm/relay/frontend/tflite.py Outdated
align_corners = resize_options.AlignCorners()

# Use layout NHWC
out = _op.image.resize(in_expr, size, "NHWC", method, align_corners)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After previous, we could use tuple(target_size)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment threadpython/tvm/relay/frontend/tflite.py Outdated
# size - 1-D int32 Tensor of 2 elements: new_height, new_width
size = self.get_tensor_value(input_tensors[1])
# convert numpy array to tuple
size = (size[0], size[1])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest better name. Like this:

target_size=self.get_tensor_value(input_tensors[1])

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@apivovarov

apivovarov commented Jun 14, 2019

Copy link
Copy Markdown
ContributorAuthor

Frontend GPU test group failed
http://ci.tvm.ai:8080/blue/organizations/jenkins/tvm/detail/PR-3370/1/pipeline
Error:

Traceback (most recent call last):
File "/workspace/python/tvm/relay/frontend/tflite.py", line 235, in _convert_resize
from tflite.ResizeNearestNeighborOptions import ResizeNearestNeighborOptions
ModuleNotFoundError: No module named 'tflite.ResizeNearestNeighborOptions'

It means that Jenkins worker still uses old tflite flatbuffers schema from Tensorflow 1.12
Recently I updated ubuntu_install_tflite.sh to use schema from version 1.13
https://github.com/dmlc/tvm/blob/master/docker/install/ubuntu_install_tflite.sh#L38
It was merged 16 hours ago

Schema v 1.13

https://raw.githubusercontent.com/tensorflow/tensorflow/r1.13/tensorflow/lite/schema/schema.fbs

@yongwwwyongwww left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apivovarov

Copy link
Copy Markdown
ContributorAuthor

I opened an issue for the build error #3373

@apivovarov

apivovarov commented Jun 14, 2019

Copy link
Copy Markdown
ContributorAuthor

Fixed the PR to support both tflite versions - 1.12 and 1.13
RESIZE_NEAREST_NEIGHBOR operator is visible in BuiltinOperator directory starting from v1.13

>>> "RESIZE_NEAREST_NEIGHBOR" in dir(BuiltinOperator())
1.12 - False
1.13 - True

@apivovarov

Copy link
Copy Markdown
ContributorAuthor

@kevinthesun Can you merge it?

@kevinthesun
kevinthesun merged commit 40d56b5 into apache:masterJun 18, 2019
wweic pushed a commit to wweic/tvm that referenced this pull request Jun 26, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Jun 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@apivovarov@FrozenGene@yongwww@kevinthesun