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

Mismatch between BlendshapeV2 TensorFlow and TFLite Model #411

Open
electricdr4gon opened this issue May 23, 2024 · 0 comments
Open

Mismatch between BlendshapeV2 TensorFlow and TFLite Model #411

electricdr4gon opened this issue May 23, 2024 · 0 comments

Comments

@electricdr4gon
Copy link

Issue Type

Bug

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

TensorFlow, TensorFlowLite

Model name and Weights/Checkpoints URL

390_BlendshapeV2

Description

TensorFlow Saved Model format version of the BlendshapeV2 model yields significantly different results from the TFLite Version (face_blendshapes.tflite)

Relevant Log Output

No response

URL or source code for simple inference testing code

import tensorflow as tf
import numpy as np

test_data = np.random.rand((1, 146, 2))

model = tf.saved_model.load("BlendshapesV2/saved_model")
model_sd = model.signatures["serving_default"]

interp = tf.lite.Interpreter("BlendshapeV2/face_blendshapes.tflite")
interp.allocate_tensors()
input_tensor = interp.get_input_details()[0]["index"]
output_tensor = interp.get_output_details()[0]["index"]

interp.set_tensor(input_tensor, test_data)
interp.invoke()
out_tflite = interp.get_tensor(output_tensor)

out_tf = model_sd(input_points = test_data)["output"]

# Comparing the "out_tf" and "out_tflite" tensors, it can be observed that results will be off by a significant margin.
@electricdr4gon electricdr4gon changed the title Missmatch between BlendshapeV2 TensorFlow and TFLite Model Mismatch between BlendshapeV2 TensorFlow and TFLite Model May 23, 2024
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

No branches or pull requests

1 participant