Skip to content

Conversation

@apivovarov
Copy link
Contributor

Add RESIZE operators to Realy TFLite frontend

Request to support RESIZE_BILLINEAR operators comes from #3189

@apivovarov
Copy link
Contributor Author

@FrozenGene @yongwww Could you have a look?

align_corners = resize_options.AlignCorners()

# Use layout NHWC
out = _op.image.resize(in_expr, size, "NHWC", method, align_corners)
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

fixed

# 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
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
Contributor Author

Choose a reason for hiding this comment

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

fixed

@apivovarov
Copy link
Contributor Author

apivovarov commented Jun 14, 2019

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

Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

LGTM

@apivovarov
Copy link
Contributor Author

I opened an issue for the build error #3373

@apivovarov
Copy link
Contributor Author

apivovarov commented Jun 14, 2019

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
Contributor Author

@kevinthesun Can you merge it?

@kevinthesun kevinthesun merged commit 40d56b5 into apache:master Jun 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 free to 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