rknn-toolkit icon indicating copy to clipboard operation
rknn-toolkit copied to clipboard

用resnet50做backbone训练reid行人特征提取, 转成rknn模型后结果会完全错误

Open MayItbever opened this issue 3 years ago • 7 comments

请问用resnet50做backbone训练reid行人特征提取,当模型输出特征没有零值的时候转成rknn全部正常。当某个训练出的模型输出特征数据是下面结构时(特征有一半是0值,但是已经收敛,用来比对也很正常),转成rknn模型后结果会完全错误,现象是转成rknn模型后不同图片会出现同样输出。是因为什么原因? image

测试了3种方式, 1: pytorch直接转rknn,不量化do_quantization=False 2: pytorch直接转rknn,不量化do_quantization=True, 300张图片量化 3:pytorch先转onnx,onnx输出结果与pytorch一致,比对相似度也一致。onnx转rknn后,模型输出结果错误,比对相似度全为0,不同图片输出特征一样

MayItbever avatar Aug 09 '22 02:08 MayItbever

我用resnet50 训练reid提取特征,也遇到完全不相同图像结果99%近似。

zishui-wu avatar Aug 10 '22 01:08 zishui-wu

  1. 如果浮点模型的结果就存在异常,大概率是 toolkit/ librknn_runtime 的bug。可以尝试更新到1.7.3版本
  2. 如果更新到1.7.3仍未解决,可以上传模型,我们复现下问题

zen-xingle avatar Sep 01 '22 02:09 zen-xingle

想问下,两位大佬的问题解决了吗

Takizzl avatar Nov 05 '22 07:11 Takizzl

更新至1.7.3后,问题并未解决。

LucreKiwisGit avatar Mar 26 '23 06:03 LucreKiwisGit

  1. 如果浮点模型的结果就存在异常,大概率是 toolkit/ librknn_runtime 的bug。可以尝试更新到1.7.3版本
  2. 如果更新到1.7.3仍未解决,可以上传模型,我们复现下问题

如何上传模型?

LucreKiwisGit avatar Mar 26 '23 07:03 LucreKiwisGit

  1. If the results of the floating-point model are abnormal, it is most likely a bug in the toolkit/librknn_runtime. You can try updating to version 1.7.3
  2. If the problem is still not solved after updating to 1.7.3, you can upload the model and we can reproduce the problem.

@zen-xingle @zishui-wu @Takizzl @MayItbever @LucreKiwisGit Hi there here is the model, please can you help debug? I have uploaded convert and inference script, onnx model as well https://drive.google.com/file/d/1JGEzQafrh0i_QOpkp8uBhnjK04OkEWJL/view?usp=sharing

RamatovInomjon avatar Jan 18 '24 05:01 RamatovInomjon

同样的问题,使用模型https://github.com/KaiyangZhou/deep-person-reid.git rknn-toolkit 结果完全错误 rknn-toolkit2 数据大致一致

aijle avatar Jun 27 '24 05:06 aijle