Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I met a error when I use the read_vec_int_ark function #54

Open
lunar333 opened this issue Nov 29, 2022 · 1 comment
Open

I met a error when I use the read_vec_int_ark function #54

lunar333 opened this issue Nov 29, 2022 · 1 comment

Comments

@lunar333
Copy link

elif mode == "rb":
err=open(output_folder+'/log.log',"a")
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,stderr=err)
threading.Thread(target=cleanup,args=(proc,cmd)).start() # clean-up thread,
return proc.stdout

when the progarm at threading.Thread(target=cleanup,args=(proc,cmd)).start() # clean-up thread,
def cleanup(proc, cmd):
ret = proc.wait()
if ret > 0:
raise SubprocessFailed('cmd %s returned %d !' % (cmd,ret))
return
it reminds me that
data_io.SubprocessFailed: cmd gunzip -c /home/sxyl3800/workspace/kaldi/egs/timit/s5/exp/dnn4_pretrain-dbn_dnn_ali_test/ali*.gz | ali-to-pdf /home/sxyl3800/workspace/kaldi/egs/timit/s5/exp/dnn4_pretrain-dbn_dnn_ali_test/final.mdl ark:- ark:- returned 127 !
whats the cleanup function for? why ret = proc.wait()>0,it will have a error?

@lunar333
Copy link
Author

the full use program is as followed

lab_folder='/home/sxyl3800/workspace/kaldi/egs/timit/s5/exp/dnn4_pretrain-dbn_dnn_ali_test'
lab_opts='ali-to-pdf'
out_folder='/home/sxyl3800/workspace/e2e-sincnet/egs/timit/asr1/data/test_raw_25ms'
wav_lst='/home/sxyl3800/workspace/e2e-sincnet/egs/timit/asr1/data/test_raw_25ms/wav.lst'
scp_file_out='/home/sxyl3800/workspace/e2e-sincnet/egs/timit/asr1/data/test_raw_25ms/feats_raw.scp'

sig_fs=16000 # Hz
sig_wlen=25 # ms

lab_fs=16000 #Hz
lab_wlen=25 #ms
lab_wshift=10 #ms

sig_wlen_samp=int((sig_fssig_wlen)/1000)
lab_wlen_samp=int((lab_fs
lab_wlen)/1000)
lab_wshift_samp=int((lab_fs*lab_wshift)/1000)

Create the output folder

try:
os.stat(out_folder)
except:
os.makedirs(out_folder)

Creare the scp file

scp_file = open(scp_file_out,"w")

reading the labels

lab= { k:v for k,v in read_vec_int_ark('gunzip -c '+lab_folder+'/ali*.gz | '+lab_opts+' '+lab_folder+'/final.mdl ark:- ark:-|', out_folder)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant