ValueError: operands could not be broadcast together with shapes (400,2) (400,)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
从所提供脚本中的 plp(signal, rasta=True) 调用开始,并检查 sidekit/frontend/features.py 中 power_spectrum 的第 399 行。使用所引用的 WAV 输入重现故障,然后跟踪 signal、framed[start:stop, :] 和 window 的形状。对于预期的 WAV 输入,PLP 提取不再引发 broadcasting 错误即表示完成。
由索引模型根据 Issue 内容生成。
描述
Dear concerns : I am extracting features from wav , using PLP , this ( Pyhton 3.6 -Anaconda Spyder ) after execute i am facing error in this line
File "C:\ProgramData\Anaconda3\lib\site-packages\sidekit\frontend\features.py", line 399, in power_spectrum
ahan = framed[start:stop, :] * window
ValueError: operands could not be broadcast together with shapes (400,2) (400,)
#!usr/bin/python
import numpy.matlib
import scipy
from scipy.fftpack.realtransforms import dct
from sidekit.frontend.vad import pre_emphasis
from sidekit.frontend.io import *
from sidekit.frontend.normfeat import *
from sidekit.frontend.features import *
import scipy.io.wavfile as wav
import numpy as np
def readWavFile(wav):
#given a path from the keyboard to read a .wav file
#wav = raw_input('Give me the path of the .wav file you want to read: ')
inputWav = 'C:/Speech_Processing/2-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques'+wav
return inputWav
#reading the .wav file (signal file) and extract the information we need
def initialize(inputWav):
rate , signal = wav.read(readWavFile(inputWav)) # returns a wave_read object , rate: sampling frequency
sig = wave.open(readWavFile(inputWav))
# signal is the numpy 2D array with the date of the .wav file
# len(signal) number of samples
sampwidth = sig.getsampwidth()
print ('The sample rate of the audio is: ',rate)
print ('Sampwidth: ',sampwidth)
return signal , rate
def PLP():
folder = input('Give the name of the folder that you want to read data: ')
amount = input('Give the number of samples in the specific folder: ')
for x in range(1,int(amount)+1):
wav = '/'+folder+'/'+str(x)+'.wav'
print (wav)
#inputWav = readWavFile(wav)
signal,rate = initialize(wav)
#returns PLP coefficients for every frame
plp_features = plp(signal,rasta=True)
meanFeatures(plp_features[0])
#compute the mean features for one .wav file (take the features for every frame and make a mean for the sample)
def meanFeatures(plp_features):
#make a numpy array with length the number of plp features
mean_features=np.zeros(len(plp_features[0]))
#for one input take the sum of all frames in a specific feature and divide them with the number of frames
for x in range(len(plp_features)):
for y in range(len(plp_features[x])):
mean_features[y]+=plp_features[x][y]
mean_features = (mean_features / len(plp_features))
print (mean_features)
def main():
PLP()
main()
- 主要语言
- Jupyter Notebook
- 星标
- 12.7k
- 派生
- 4.4k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rasbt/python-machine-learning-book 的其他 Issue
-
难度 5/5 一周以上 新手友好度 5/100
rasbt/python-machine-learning-book#99 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 35/100
rasbt/python-machine-learning-book#98 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
rasbt/python-machine-learning-book#95 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 18/100
-
难度 2/5 1-3 小时 新手友好度 55/100
rasbt/python-machine-learning-book#74 · 1 条评论 · 2 个 reaction ·
查看 rasbt/python-machine-learning-book 的全部 Issue
相似的 Issue
-
Potential Bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ostris/ai-toolkit#1076 ·
维护者通常 2 天内回复
-
good first issue hacktoberfest
难度 2/5 半天 新手友好度 62/100
-
qwen3-asr: passing vocab.json as the tokenizer argument fails with a misleading error可能已有人在做 @paoloantinori 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
k2-fsa/sherpa-onnx#4036 ·
维护者通常 1 天内回复