-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
mxnet --> onnx converted insightface arcface model generates incorrect inference results #1417
Comments
onnx.version == '1.2.1' should work well. |
@cyrusbehr it looks like you are using different code for image preprocessing for mxnet version and ONNX version.
You can also check my scripts here: insight_tester.py |
@SthPhoenix that did the trick thank you. |
图像张量不减均值除方差吗? |
That's true for newer models trained with pytorch |
no pytorch, while tensor was minus and mul in mxnet, because model-symbol.json of mxnet was marked as below:
|
I am trying to convert the Insightface arcface LResNet100E-IR,ArcFace@ms1m-refine-v2 mxnet model to work with onnx.
Based on this issue, it looks like mxnet only supports up to onnx v1.3.0. I am therefore using the following library verions:
It looks like out of the box the arcface model is not support by onnx, but I came across this issue which which links a script for properly converting the arcface model to onnx.
Running the script converts the model from mxnet format to onnx format successfully, however the output is no longer correct.
Here is my mxnet script I use for running inference (using a pre-aligned face chip):
I print the first element of the feature vector, which is:
2.216425
Now here is my script for running inference with onnxruntime:
Again, I print the first element of the feature vector, which is now:
-0.19618489
.This is clearly not correct. What have I done wrong? Has the conversion failed?
The text was updated successfully, but these errors were encountered: