k2-fsa / sherpa-ncnn

Real-time speech recognition and voice activity detection (VAD) using next-gen Kaldi with ncnn without Internet connection. Support iOS, Android, Linux, macOS, Windows, Raspberry Pi, VisionFive2, LicheePi4A etc.
https://k2-fsa.github.io/sherpa/ncnn/index.html
Apache License 2.0
996 stars 154 forks source link

修复最新ncnn推理错误的问题 #252

Open nihui opened 1 year ago

nihui commented 1 year ago

关联 https://github.com/Tencent/ncnn/issues/4878

zipformer-encoder 末尾这里 红框这个 BinaryOp 的输入,一边是 3 维 w=160 h=2 c=8,一边是 1 维 w=160,这不适用于 ncnn 的 implicit broadcast https://github.com/Tencent/ncnn/wiki/binaryop-broadcasting

需要修改 MemoryData 为 3 维,修改后新旧ncnn都可以兼容

MemoryData               downsample_output        0 1 2026 0=160

修改为

MemoryData               downsample_output        0 1 2026 0=160 1=1 2=1

图片