tensorflow_end2end_speech_recognition icon indicating copy to clipboard operation
tensorflow_end2end_speech_recognition copied to clipboard

Error in list2sparsetensor

Open cuhkebook opened this issue 6 years ago • 0 comments

I got an error as

if l == padded_value: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I found "l" is a 1D array and cannot be compared to single value so in the trainin_joint_ctc_attention, the ctc_labels (bold one in below, which equals to "l" in above) should be ctc_labels[0] or ctc_labels?


feed_dict_train = { model.inputs_pl_list[0]: inputs[0], model.labels_pl_list[0]: labels_train[0], model.ctc_labels_pl_list[0]: list2sparsetensor( ctc_labels, padded_value=train_data.ctc_padded_value), model.inputs_seq_len_pl_list[0]: inputs_seq_len[0], model.labels_seq_len_pl_list[0]: labels_seq_len[0], model.keep_prob_encoder_pl_list[0]: 1 - float(params['dropout_encoder']), model.keep_prob_decoder_pl_list[0]: 1 - float(params['dropout_decoder']), model.keep_prob_embedding_pl_list[0]: 1 - float(params['dropout_embedding']), learning_rate_pl: learning_rate }

cuhkebook avatar Oct 26 '17 07:10 cuhkebook