I just finished training a model with good results, and serialized it using torch.jit.trace(). However, the model performs very poorly when deployed to my Android phone.
While investigating the cause of the performance difference between devices, I ran both models (pc and android) using a zero-tensor as input. To my surprise, I found out the model outputs are totally different.
This would explain the poor results (since the mobile model essentially outputs nonsense values). But is this considered a bug or am I doing something wrong on my end?
In short - Android will not update asset files when these are changed. You must manually clear the caches through the phone/emulator settings => apps menu (sigh…)
The app was running an older model (one of many trials), causing the discrepancies I saw.