zzw922cn / Automatic_Speech_Recognition

End-to-end Automatic Speech Recognition for Madarian and English in Tensorflow
MIT License
2.84k stars 538 forks source link

NoneType' and 'int' #29

Open jren2017 opened 6 years ago

jren2017 commented 6 years ago

Traceback (most recent call last): File "/administrator/PycharmProjects/Automatic_Speech_Recognition/feature/libri/libri_preprocess.py", line 176, in mode=mode, feature_len=feature_len, seq2seq=seq2seq, save=True) File "/administrator/PycharmProjects/Automatic_Speech_Recognition/feature/libri/libri_preprocess.py", line 90, in wav2feature feat = calcfeat_delta_delta(sig,rate,win_length=win_len,win_step=win_step,mode=mode,feature_len=feature_len) File "/administrator/PycharmProjects/Automatic_Speech_Recognition/feature/core/calcmfcc.py", line 68, in calcfeat_delta_delta feat = calcMFCC(signal,samplerate,win_length,win_step,feature_len,filters_num,NFFT,low_freq,high_freq,pre_emphasis_coeff,cep_lifter,appendEnergy,mode=mode) #首先获取13个一般MFCC系数 File "/administrator/PycharmProjects/Automatic_Speech_Recognition/feature/core/calcmfcc.py", line 118, in calcMFCC feat,energy=fbank(signal,samplerate,win_length,win_step,filters_num,NFFT,low_freq,high_freq,pre_emphasis_coeff) File "/administrator/PycharmProjects/Automatic_Speech_Recognition/feature/core/calcmfcc.py", line 151, in fbank high_freq=high_freq or samplerate/2 TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

when I run the libri_preprocess.py, the above error occured? how to solve it

zzw922cn commented 6 years ago

@jren2017 hi, i haven't met this problem before, you had better check the type of high_freq or samplerate, if necessary, add a 'int' before two variables. like 'int(samplerate)'.