声音分类ESC50 Example模型部署出错!TypeError: only size-1 arrays can be converted to Python scalars #3462
Unanswered
policemanxxx
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
【过程】
模型训练->模型预测->动转静->模型部署
【错误描述】
通过命令 ./run.sh 4 gpu ./export /audio/dog.wav 进行第4步骤。
无法正确执行,尝试各种方法无果,请求协助!
【环境变量】
paddleaudio 1.0.2
paddlepaddle-gpu 2.5.0
paddlespeech 0.0.0
【具体报错如下】
I0809 15:22:10.513600 24904 analysis_predictor.cc:1660] ======= optimize end =======
I0809 15:22:10.513777 24904 naive_executor.cc:164] --- skip [feed], feed -> x
I0809 15:22:10.514379 24904 naive_executor.cc:164] --- skip [linear_4.tmp_1], fetch -> fetch
W0809 15:22:10.516772 24904 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.2
W0809 15:22:10.518486 24904 gpu_resources.cc:149] device: 0, cuDNN Version: 8.1.
Traceback (most recent call last):
File "/home/workstation/chenwh/PaddleSpeech/paddlespeech/cls/exps/panns/deploy/predict.py", line 144, in
results = predictor.predict(wavs)
File "/home/workstation/chenwh/PaddleSpeech/paddlespeech/cls/exps/panns/deploy/predict.py", line 120, in predict
feats = extract_features(wavs)
File "/home/workstation/chenwh/PaddleSpeech/paddlespeech/cls/exps/panns/deploy/predict.py", line 58, in extract_features
feat = MelSpectrogram(waveforms[i], sr, **kwargs).transpose()
File "/root/anaconda3/envs/cwh-test/lib/python3.8/site-packages/paddle/audio/features/layers.py", line 181, in init
self.fbank_matrix = compute_fbank_matrix(
File "/root/anaconda3/envs/cwh-test/lib/python3.8/site-packages/paddle/audio/functional/functional.py", line 227, in compute_fbank_matrix
fftfreqs = fft_frequencies(sr=sr, n_fft=n_fft, dtype=dtype)
File "/root/anaconda3/envs/cwh-test/lib/python3.8/site-packages/paddle/audio/functional/functional.py", line 183, in fft_frequencies
return paddle.linspace(0, float(sr) / 2, int(1 + n_fft // 2), dtype=dtype)
TypeError: only size-1 arrays can be converted to Python scalars
Beta Was this translation helpful? Give feedback.
All reactions