Closed Johe-cqu closed 5 months ago
What is the context size of your model?
--decode-chunk-len 32 --num-left-chunks 4
I mean, --context-size
--context-size=2
I get more log,and i can‘t find SherapMetaData in encoder_jit_trace-pnnx.ncnn.param. How to fix it?
2024-06-04 19:08:34.495 13901-13901 ncnn com.k2fsa.sherpa.ncnn W Unable to create a model from specified model files.
Please check:
1. If you are using a ConvEmformer/Zipformer/LSTM model, please make sure you have added SherapMetaData to encoder_xxx.ncnn.param (or encoder_xxx.ncnn.int8.param if you are using an int8 model). You need to add it manually after converting the model with pnnx.
2. (Android) Whether the app requires an int8 model or not
2024-06-04 19:08:34.498 13901-13901 libc com.k2fsa.sherpa.ncnn A Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 13901 (fsa.sherpa.ncnn), pid 13901 (fsa.sherpa.ncnn)
2024-06-04 19:08:34.627 20481-20481 DEBUG pid-20481 A pid: 13901, tid: 13901, name: fsa.sherpa.ncnn >>> com.k2fsa.sherpa.ncnn <<<
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #00 pc 00000000000330f4 /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/lib/arm64/libsherpa-ncnn-core.so (sherpa_ncnn::GreedySearchDecoder::GetEmptyResult() const+36) (BuildId: a0f98d011401c3dc0de238d2af864d2ab137b045)
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #01 pc 000000000003df94 /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/lib/arm64/libsherpa-ncnn-core.so (sherpa_ncnn::Recognizer::Impl::CreateStream() const+548) (BuildId: a0f98d011401c3dc0de238d2af864d2ab137b045)
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #02 pc 0000000000002c2c /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/lib/arm64/libsherpa-ncnn-jni.so (Java_com_k2fsa_sherpa_ncnn_SherpaNcnn_newFromAsset+184) (BuildId: cf4bc21817aed6d528bcd0cbc4eaa3bdc998cea4)
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #10 pc 0000000000003c50 [anon:dalvik-classes3.dex extracted in memory from /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/base.apk!classes3.dex] (com.k2fsa.sherpa.ncnn.SherpaNcnn.<init>)
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #16 pc 0000000000001ce4 [anon:dalvik-classes3.dex extracted in memory from /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/base.apk!classes3.dex] (com.k2fsa.sherpa.ncnn.MainActivity.initModel)
2024-06-04 19:08:34.728 20481-20481 DEBUG pid-20481 A #22 pc 0000000000001dac [anon:dalvik-classes3.dex extracted in memory from /data/app/~~2kd-bxW8As8Y_U_6iRhfCQ==/com.k2fsa.sherpa.ncnn-UY8Jbq6qYwco4o3OO2mbiA==/base.apk!classes3.dex] (com.k2fsa.sherpa.ncnn.MainActivity.onCreate)
The fix is to.follow.the doc strictly.
thank you so much. Fix it
Using the model you provided (sherpa-ncnn-streaming-zipformer-zh-14m-2023-02-23-chinese), the apk can run normally. But when I use the model I trained myself, it crashes. BTW: The model I trained myself can generate text successfully when using ./pruned_transducer_stateless7_streaming/streaming-ncnn-decode.py.
Can you tell me where I went wrong?
This is the log I got from logcat.