Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tflite label_image resize bug #22310

Closed
tataganesh95 opened this issue Sep 17, 2018 · 1 comment
Closed

Tflite label_image resize bug #22310

tataganesh95 opened this issue Sep 17, 2018 · 1 comment
Assignees
Labels
comp:lite TF Lite related issues

Comments

@tataganesh95
Copy link

tataganesh95 commented Sep 17, 2018

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    Linux
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
    NA
  • TensorFlow installed from (source or binary):
    Source
  • TensorFlow version (use command below):
    1.10
  • Python version:
    3.5
  • Bazel version (if compiling from source):
    0.15
  • GCC/Compiler version (if compiling from source):
    NA
  • CUDA/cuDNN version:
    NA
  • GPU model and memory:
    NA
  • Exact command to reproduce:
    NA

Describe the problem

In the label_image.cc example of TFlite, a resize function present in bitmap_helpers_impl.h is being called in line 171 -
resize<float>(interpreter->typed_tensor<float>(input), in.data(),

In the implementation of the function in bitmap_helpers_impl.h, the following line

  auto output_number_of_pixels =
      wanted_height * wanted_height * wanted_channels;

assumes that for the input image, the height and width must be the same. And this works for the mobilenet example since the input size is 224 x 224. But, this would cause issues for any network where the expected input size does not have the same width and height. It should instead be -

   auto output_number_of_pixels =
      wanted_width * wanted_height * wanted_channels;

Source code / logs

NA

@drpngx drpngx assigned aselle and unassigned drpngx Sep 17, 2018
@drpngx drpngx added the comp:lite TF Lite related issues label Sep 17, 2018
freedomtan added a commit to freedomtan/tensorflow that referenced this issue Sep 18, 2018
@shahid14
Copy link

shahid14 commented Dec 5, 2018

#22377 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues
Projects
None yet
Development

No branches or pull requests

4 participants