yeyupiaoling / PaddlePaddle-DeepSpeech

基于PaddlePaddle实现的语音识别,中文语音识别。项目完善,识别效果好。支持Windows,Linux下训练和预测,支持Nvidia Jetson开发板预测。
https://yeyupiaoling.blog.csdn.net/article/details/102904306
Apache License 2.0
649 stars 143 forks source link

ValueError: operands could not be broadcast together with shapes (161,838) (39,1) #145

Closed harryNLP closed 2 years ago

harryNLP commented 2 years ago

I am running the demo follow your instructions but encounter a problem, the error message is shown as follows. My operating system is Macos

python3 infer_path.py --wav_path=./dataset/test.wav ----------- Configuration Arguments ----------- alpha: 1.2 beam_size: 300 beta: 0.35 cutoff_prob: 0.99 cutoff_top_n: 40 decoding_method: ctc_greedy enable_mkldnn: False is_long_audio: False lang_model_path: ./lm/zh_giga.no_cna_cmn.prune01244.klm mean_std_path: ./dataset/mean_std.npz model_dir: ./models/infer/ to_an: True use_gpu: False vocab_path: ./dataset/zh_vocab.txt wav_path: ./dataset/test.wav

E0520 19:05:52.228500 471705088 analysis_config.cc:95] Please compile with gpu to EnableGpu() Traceback (most recent call last): File "/Users/huanghaowei/Downloads/PaddlePaddle-DeepSpeech-master/infer_path.py", line 34, in predictor = Predictor(model_dir=args.model_dir, audio_process=audio_process, decoding_method=args.decoding_method, File "/Users/huanghaowei/Downloads/PaddlePaddle-DeepSpeech-master/utils/predict.py", line 69, in init self.predict(warmup_audio_path, to_an=True) File "/Users/huanghaowei/Downloads/PaddlePaddle-DeepSpeech-master/utils/predict.py", line 76, in predict audio_feature = self.audio_process.process_utterance(audio_path) File "/Users/huanghaowei/Downloads/PaddlePaddle-DeepSpeech-master/data_utils/audio_process.py", line 44, in process_utterance specgram = self._normalizer.apply(specgram) File "/Users/huanghaowei/Downloads/PaddlePaddle-DeepSpeech-master/data_utils/normalizer.py", line 55, in apply return (features - self._mean) / (self._std + eps) ValueError: operands could not be broadcast together with shapes (161,838) (39,1)

yeyupiaoling commented 2 years ago

你下载的模型文件有没有全部替换原来的了,注意是dataset里面的文件