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

pnnx.py and ncnn.py for resnet18 has a slight different final outputs #5800

Open
Bing1002 opened this issue Nov 26, 2024 · 0 comments
Open

Comments

@Bing1002
Copy link

error log | 日志或报错信息 | ログ

pnnx.py output:
$ python resnet18_torchscript_pnnx.py
tensor([[-1.5752e+00, 6.8381e-01, 1.4599e+00, 1.1986e+00, 1.0503e+00,
-5.0585e-01, 9.1963e-01, 1.4127e-01, -1.2256e+00, -3.8200e-01,
1.1840e+00, 2.5817e+00, 1.3319e+00, 2.8250e+00, 2.6328e+00,
1.1827e+00, 1.6862e+00, 2.9742e-01, 1.5851e+00, 1.9562e+00,
6.5654e-01, 2.2326e+00, 1.8743e+00, 1.8355e+00, 5.0387e-01,
1.7909e-01, 4.9693e-01, 6.8537e-01, -1.9073e-01, -1.3404e+00,
-5.2751e-01, 1.2330e+00, -5.4223e-01, 9.8114e-01, 2.2979e+00,
-5.1950e-01, -4.2796e-01, -1.1896e-01, 1.3294e+00, 1.9918e-01,
2.3761e+00, 1.0134e+00, 1.8879e+00, 3.5642e-01, 1.6943e+00,
4.4768e-01, 2.1218e+00, -4.0468e-01, -9.0379e-02, -7.7178e-02,

ncnn.py output:
$ python resnet18_torchscript_ncnn.py
tensor([[-1.5879e+00, 6.8066e-01, 1.4541e+00, 1.1836e+00, 1.0615e+00,
-5.0098e-01, 9.2188e-01, 1.5088e-01, -1.2207e+00, -3.6450e-01,
1.1777e+00, 2.5645e+00, 1.3398e+00, 2.8066e+00, 2.6289e+00,
1.1924e+00, 1.6914e+00, 2.9736e-01, 1.5830e+00, 1.9443e+00,
6.4844e-01, 2.2285e+00, 1.8730e+00, 1.8477e+00, 5.0488e-01,
1.8408e-01, 5.0098e-01, 6.8896e-01, -1.8799e-01, -1.3389e+00,
-5.3809e-01, 1.2305e+00, -5.4541e-01, 9.7656e-01, 2.2754e+00,
-5.2344e-01, -4.3628e-01, -1.1523e-01, 1.3418e+00, 2.1558e-01,
2.3828e+00, 1.0273e+00, 1.8945e+00, 3.7061e-01, 1.7021e+00,
4.5581e-01, 2.1328e+00, -3.9160e-01, -8.2886e-02, -5.1147e-02,

Even i changed tensor.contiguous(), the difference is still there. I want to know if this minor difference is normal.

context | 编译/运行环境 | バックグラウンド

Raspberry pi 5

how to reproduce | 复现步骤 | 再現方法

more | 其他 | その他

@Bing1002 Bing1002 changed the title pnnx.py and ncnn.py for resnet18 has a slightly different final outputs pnnx.py and ncnn.py for resnet18 has a slight different final outputs Nov 26, 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