问题描述
我使用k210采集了两类物品的图片,分别是龙眼和十字改锥。使用PC训练出了tflite文件,在PC使用该tflite文件推理,验证了模型的效果基本满足预期。然后使用github上获取的0.1.0rc5的nncase(win7版本,我的系统是win11)将tflite文件转化为kmodel,将kmodel拷贝至sd卡并正确加载模型后,推理值异常。推理结果一直为0.52xxxx的“龙眼”只有万分位以后的数值在变化,变化幅度很小。
使用nncase转化模型时提示:
I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
0: InputLayer -> 1x3x224x224
1: K210Conv2d 1x3x224x224 -> 1x8x112x112
2: K210Conv2d 1x8x112x112 -> 1x16x56x56
3: K210Conv2d 1x16x56x56 -> 1x32x28x28
4: K210Conv2d 1x32x28x28 -> 1x48x14x14
5: K210Conv2d 1x48x14x14 -> 1x64x7x7
6: K210Conv2d 1x64x7x7 -> 1x1x7x7
7: Dequantize 1x1x7x7 -> 1x1x7x7
8: GlobalAveragePool 1x1x7x7 -> 1x1x1x1
9: Reshape 1x1x1x1 -> 1x1
10: Logistic 1x1 -> 1x1
11: OutputLayer 1x1
KPU memory usage: 2097152 B
Main memory usage: 256 B
求教,感谢。
复现步骤
使用nncase0.1.0rc5转化模型即可复现,完整的转化代码:
..\ncc-0.1.0\ncc .\exports_fp32\model_fp32.tflite .\k210\dogcat.kmodel -i tflite -o k210model --dataset .\dataset\train
硬件板卡
幻尔K210
软件版本
nncase-0.1.0-rc5
其他信息
我尝试过使用nncase0.2.0,0.2.0的命令行工具有infer指令,因此我可以在PC上验证我的kmodel,但不管是在k210中还是在PC上,验证效果都不如nncase0.1.0版本,具体说就是nncase0.2.0转化出的模型,起推理结果是一个接近50的固定的常数。
