赞
踩
具体的开发过程网上都有,就不赘述了。
在colab上训练模型,花了将近2小时,得到模型文件后,CV到micro_speech工程里的micro_features_model.cpp里,结果运行报错:
Feature generation failed
Requested feature_data_ size 536907080 doesn't match 1960
最终在github上找到了解决方法,记录一下,在micro_speech.ino中作如下修改:
static tflite::MicroMutableOpResolver<5> micro_op_resolver(error_reporter); if (micro_op_resolver.AddDepthwiseConv2D() != kTfLiteOk) { return; } if (micro_op_resolver.AddFullyConnected() != kTfLiteOk) { return; } if (micro_op_resolver.AddSoftmax() != kTfLiteOk) { return; } if (micro_op_resolver.AddReshape() != kTfLiteOk) { return; } if (micro_op_resolver.AddConv2D() != kTfLiteOk) { return; }
其实就是增加了
if (micro_op_resolver.AddConv2D() != kTfLiteOk) { return; }
并把
static tflite::MicroMutableOpResolver<4> micro_op_resolver(error_reporter);
改成
static tflite::MicroMutableOpResolver<5> micro_op_resolver(error_reporter);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。