当前位置:   article > 正文

TinyML之micro_speech语音识别----Feature generation failed解决方案

TinyML之micro_speech语音识别----Feature generation failed解决方案

具体的开发过程网上都有,就不赘述了。

colab上训练模型,花了将近2小时,得到模型文件后,CV到micro_speech工程里的micro_features_model.cpp里,结果运行报错:

Feature generation failed
Requested feature_data_ size 536907080 doesn't match 1960
  • 1
  • 2

最终在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; 
  }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

其实就是增加了

if (micro_op_resolver.AddConv2D() != kTfLiteOk) { return; }
  • 1

并把

static tflite::MicroMutableOpResolver<4> micro_op_resolver(error_reporter);
  • 1

改成

static tflite::MicroMutableOpResolver<5> micro_op_resolver(error_reporter);
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/544231
推荐阅读
相关标签
  

闽ICP备14008679号