Closed phecda-xu closed 5 years ago
@phecda-xu — a snapshot of nvidia-smi
may not be the best proxy for how much the GPU is actually being used considering there are some CPU-bound parts of training. Is the lower usage you see consistent over time? How many cores is your CPU/how much memory is available?
It's possible your model is simply diverging from the start. I'd start by trying a few suggestions in https://github.com/facebookresearch/wav2letter/issues/168. Certainly decrease your learning rate to see if you can get a valid loss.
@phecda-xu — a snapshot of
nvidia-smi
may not be the best proxy for how much the GPU is actually being used considering there are some CPU-bound parts of training. Is the lower usage you see consistent over time? How many cores is your CPU/how much memory is available?It's possible your model is simply diverging from the start. I'd start by trying a few suggestions in #168. Certainly decrease your learning rate to see if you can get a valid loss.
@jacobkahn Thanks for your reply! I have checked it again and you are right, the usage of GPU is volatile. I changed the "lr" from 0.1 to 0.0001 to get a valid loss,and it works! Thank you very much!
@phecda-xu I am working on Chinese speech recognition. I am wondering if you could kindly send me the source code on preprocessing aishell before putting it into Wav2Letter++ training. Thx.
@phecda-xu I am working on Chinese speech recognition. I am wondering if you could kindly send me the source code on preprocessing aishell before putting it into Wav2Letter++ training. Thx.
@keshawnhsieh I processed Aishell with pandas as I have collected txt information into a csv file. like this:
|Content|FileName |URL |
|中文文本|音频的原始名称|音频存储路径|
code is here,may have some error, so be careful!
# coding: utf-8
# by:phecda xu
# processing Aishell data for wav2letter++
import os
import pandas as pd
import shutil
import jieba
base_path = 'data/'
data_aishell = pd.read_csv('data/AISHELL/AISHELL-1.csv')[['Content','FileName','URL']]
def seg_dataSet(dataFrame):
data_test = dataFrame[:int(dataFrame.shape[0]*0.05)]
data_dev = dataFrame[int(dataFrame.shape[0]*0.05) : int(dataFrame.shape[0]*0.1)]
data_train = dataFrame[int(dataFrame.shape[0]*0.1) :]
print(data_test.shape, data_dev.shape, data_train.shape, dataFrame.shape)
return data_test,data_dev,data_train
data_aishell_test, data_aishell_dev ,data_aishell_train = seg_dataSet(data_aishell)
train_data = data_aishell_train.reset_index()
del train_data['index']
test_data = data_aishell_test.reset_index()
del test_data['index']
dev_data = data_aishell_dev.reset_index()
del dev_data['index']
def pre_processing_content(dataFrame,folder):
dataFrame['path'] = dataFrame.URL.apply(lambda x:base_path + '/'.join(x.split('/')[6:]))
dataFrame['FileName'] = dataFrame.FileName.apply(lambda x:x.split('.')[0])
dataFrame['id'] = dataFrame.FileName.index.tolist()
dataFrame['new_FileName'] = dataFrame.id.apply(lambda x : "%09d"%x)
dataFrame['cut'] = dataFrame.Content.apply(lambda x:' '.join(jieba.lcut(x)))
dataFrame['token'] = dataFrame.cut.apply(lambda x:' '.join(list(x.replace(' ', '|'))))
dataFrame['newfile'] = dataFrame.new_FileName.apply(lambda x:'wav2letter++/AISHELL/data/'+ folder + '/' + x +'.wav')
return dataFrame
train = pre_processing_content(train_data,'train')
test = pre_processing_content(test_data,'test')
dev = pre_processing_content(dev_data,'dev')
train = train[['cut','token' ,'path','id','new_FileName','newfile']]
test = test[['cut','token' ,'path','id','new_FileName','newfile']]
dev = dev[['cut','token' ,'path','id','new_FileName','newfile']]
def write_id(basepath):
with open(folder_basepath +'/'+ basepath + ".id", "w") as f:
f.write("file_id\t{fid}".format(fid=int(basepath)))
def write_tkn(basepath, token):
with open(folder_basepath +'/'+ basepath + ".tkn", "w") as f:
f.write(token)
def write_wrd(basepath, cut):
with open(folder_basepath +'/'+ basepath + ".wrd", "w") as f:
f.write(cut)
def copy(file_path,newfile):
shutil.copyfile(file_path, newfile)
def export_data(dataFrame):
list(map(write_wrd,dataFrame['new_FileName'],dataFrame['cut']))
list(map(write_tkn,dataFrame['new_FileName'],dataFrame['token']))
list(map(write_id,dataFrame['new_FileName']))
list(map(copy,dataFrame['path'], dataFrame['newfile']))
def main(path, mode):
exist = os.path.exists(path + mode)
folder_basepath = path + mode
if exist:
print(folder_basepath)
else:
os.makedirs(path + mode)
print('mkdir :',folder_basepath)
#export_data(mode)
if __name__=="__main__":
main('wav2letter++/AISHELL/data/','test')
main('wav2letter++/AISHELL/data/','dev')
main('wav2letter++/AISHELL/data/','train')
@phecda-xu Could you please share your train log and test result of AIShell. Do you use Chinese language model? Thanks.
Thanks for your excellent work!
I trained with new dataSet, but loss is 'inf'
train.cfg details, on linux ubuntu 16.04
train logs
Any ideals to solve this problem? Thanks!
training seems slowly, i use one TITAN V GPU device with 12G memory,but utilization rate only about 38%.
Is there anything wrong I did or how to improve the utilization rate? looking for your help! Thanks!