How to set parameter of speech demo
I tried using part of ami data, and using the default.cfg and my transform file is like this:
TRANSFORM scp:/home/zhangjl/git/kaldi/egs/ami62_mxnet/s5/exp_mxnet/data-for-mxnet/feats2.scp
scp:/home/zhangjl/git/kaldi/egs/ami62_mxnet/s5/exp_mxnet/data-for-mxnet/post2.scp
then got some error:
Loading data into memory...
ERROR (Input():kaldi-io.cc:742) Error opening input stream TRANSFORM
[ Stack-Trace: ]
I changed transform file to
NO_FEATURE_TRANSFORM scp:/home/zhangjl/git/kaldi/egs/ami62_mxnet/s5/exp_mxnet/data-for-mxnet/feats2.scp
scp:/home/zhangjl/git/kaldi/egs/ami62_mxnet/s5/exp_mxnet/data-for-mxnet/post2.scp
then the following error reported:
Traceback (most recent call last):
File "train_lstm_proj.py", line 303, in <module>
do_training(training_method, args, module, data_train, data_val)
File "train_lstm_proj.py", line 188, in do_training
for nbatch, data_batch in enumerate(data_train):
File "/home/zhangjl/git/kaldi/egs/ami62_mxnet/s5/io_util.py", line 410, in __iter__
np_data_buffer[i][:n_take] = fea_utt[idx_take]
ValueError: could not broadcast input array from shape (20,13) into shape (20,40)
then I modifed default.cfg
xdim =40 changed to xdim = 13
then another error reported:
[14:31:29] /home/zhangjl/git/mxnet/dmlc-core/include/dmlc/logging.h:235: [14:31:29] /home/zhangjl/git/mxnet/mshadow/mshadow/././././cuda/tensor_gpu-inl.cuh:351: Check failed: (dst.size(0)) == (label.size(0)) SoftmaxGrad: label shape mismatch
[14:31:29] /home/zhangjl/git/mxnet/dmlc-core/include/dmlc/logging.h:235: [14:31:29] src/engine/./threaded_engine.h:306: [14:31:29] /home/zhangjl/git/mxnet/mshadow/mshadow/././././cuda/tensor_gpu-inl.cuh:351: Check failed: (dst.size(0)) == (label.size(0)) SoftmaxGrad: label shape mismatch
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
terminate called after throwing an instance of 'dmlc::Error'
what(): [14:31:29] src/engine/./threaded_engine.h:306: [14:31:29] /home/zhangjl/git/mxnet/mshadow/mshadow/././././cuda/tensor_gpu-inl.cuh:351: Check failed: (dst.size(0)) == (label.size(0)) SoftmaxGrad: label shape mismatch
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
Aborted (core dumped)
please show me how to set the ydim, thanks.
@yzhang87 @pluskid
@zhangjiulong seems like you need to change label size.
btw, you can change these parameters by passing "--train-xdim" into the python file.
@zhangjiulong Is this problems solved? I seem to encounter the same problem.
i run the speech demo,but got the same error: ...cuda/tensor_gpu-inl.cuh:351: Check failed: (dst.size(0)) == (label.size(0)) SoftmaxGrad: label shape mismatch
@wd929 That was due to some incompatible changes in SoftmaxOutput lately. Could you try to add preserve_shape=True when constructing SoftmaxOutput to see if it works?
@pluskid i try to add preserve_shape=true here
if take_softmax: sm = mx.sym.SoftmaxOutput(data=pred, label=label, ignore_label=0,use_ignore=True, name='softmax', preserve_shape=True) else: sm = pred
but it does`t work,the same error occured
@wd929 one temporary solution was reshape the label and pred.
pred = mx.sym.Reshape(pred, shape=(-1, num_label)) label = mx.sym.Reshape(label, shape=(-1,))
We will submit a fix soon (after we combined with cudnn-lstm).
@yzhang87 i reshape the label and pred but i got
src/operator/./reshape-inl.h:289: Check failed: oshape.Size() == dshape.Size() Target shape size is different to source. Target: 8315056683120
i try to add preserve_shape=true here
if take_softmax: sm = mx.sym.SoftmaxOutput(data=pred, label=label, ignore_label=0,use_ignore=True, name='softmax', preserve_shape=True) else: sm = pred
but it does`t work,the same error occured
2016-10-21 0:03 GMT+08:00 Chiyuan Zhang [email protected]:
@wd929 https://github.com/wd929 That was due to some incompatible changes in SoftmaxOutput lately. Could you try to add preserve_shape=True when constructing SoftmaxOutput to see if it works?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dmlc/mxnet/issues/3096#issuecomment-255150185, or mute the thread https://github.com/notifications/unsubscribe-auth/ATgiMkhlaFOxOEIHLiEK0kH7-iYaKqHwks5q15DmgaJpZM4JpjLD .
#3620 should fix this. We are planning to test cuDNN RNN cell for speech demo soon.
@pluskid I pull the newest script.But I got another error. IndexError: index 1936 is out of bounds for axis 0 with size 1936 1936 is the label dim(i.e. $ of state) I think maybe I should -1 (0~1935) but i got the same error IndexError: index 1935 is out of bounds for axis 0 with size 1935 I don`t know why
The label dimension might be different from different kaldi run. @yzhang87 Maybe we should add comments on how to read out this parameter from kaldi outputs.
@wd929 "index 1936 is out of bounds for axis 0 with size 1936", I think it means you need increase the your label dim. You can check final.occs in kaldi model file for the total number of labels.
@yzhang87 I checked the the number label is actually 1936 in final.occs and I checked label numbers in exp_mxnet/data-for-mxnet/label_mean.ark ,which is 1936 too.
Can you show me which line throw this error? By default, 0 is reserved for garbage frame, 1-label_dim was for the actual labels. Does it work if you increase the num_label in the config? It seems you feed-in some index which exceed the label_num.
@yzhang87
Traceback (most recent call last):
File "train_lstm_proj.py", line 303, in
And i increase the number of label to 1937,it seems to work...there is no error till now.
For this error, it seems due to the label index is from 1, not from 0. In train_lstm_proj.py for function def CrossEntropy(labels, preds): in the loop for i in range(preds.shape[0]), you can just let label:=label-1
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!