Skip to content

Error in list2sparsetensor #26

Open
@cuhkebook

Description

@cuhkebook

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions