google-ai-edge / ai-edge-torch

Supporting PyTorch models with the Google AI Edge TFLite runtime.
Apache License 2.0
228 stars 26 forks source link

Converted model numerically different from the original torch model #20

Closed vmanoj1996 closed 1 week ago

vmanoj1996 commented 1 month ago

I converted the torch model using, edge_model = ai_edge_torch.convert(model, sampleInput)

The model is a CNN based encoder + decoder network that outputs an 128x128 image.

Original Pytorch model output image

Converted model output image

Any ideas what can be going wrong here?

advaitjain commented 1 month ago

Expectation is for tflite output to be within tolerance of the pytorch model (validation step in the getting started Colab).

Can you share code that reproduces this behavior?

vmanoj1996 commented 1 month ago

Sorry for the lack of response. I rewrote the network in tf2 and used a more direct pipeline for tflite conversion. Not looking for a solution to this issue currently.

pkgoogle commented 1 month ago

Hi @vmanoj1996, we would really like to resolve this if possible, if you can share maybe not the exact model but something which reproduces this -- we will be happy to try this out. (Maybe something from torchvision?).

github-actions[bot] commented 2 weeks ago

Marking this issue as stale since it has been open for 7 days with no activity. This issue will be closed if no further activity occurs.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days. Please post a new issue if you need further assistance. Thanks!