Open btdan opened 11 months ago
Android and Python are different OSes and the code is not the same. This means that even pytorch, for example, is not 100% compatible between android and python, and the reproducibility of some operations may differ between versions.
You're using AI for mobile, not for python, and you shouldn't expect exactly the same results. It's probably technically easier to accept some differences than to change the random seed.
Hello, I have trained a mobilenetv2 model with the help of pytorch(version: 1.9.0) and convert to .pt format, deploy the .pt model on android mobilephone. However, I get very different result from the result on PC. Can anyone help me to solve this problem? The details are as follows: First,train the new model(named result.ckpt) from mobilenetv2(the same problem with mobilenetv3 ) with the help of pytorch. Secondly, convert the model result.ckpt to result.pt the key source codes is as follows:
Thirdly, deploy the result.pt model inside app source code. And then compile to get the apk the key source codes are as follows:
And the function compressImageFromBitmap is as follows:
However, I get quiet different result for same image to identify on PC and android Can anyone help me to solve this problem? Thans very much.
By the way, I have set random to a fix number when training the model.Just as follows:
But it does not have any change at all. Thans very much for your help . Best wishes to you.