2017-06-27 5 views
0

MFCCデータを入力として使用し、音素ラベル(音素値を整数に変換したもの)をターゲット出力として使用しています。 私はTensorflow CTC関数を使用するために利用できる音素ラベルからスパーステンソルを作成しようとしています。私は受け付けておりTensorflowのCTCLossが範囲外インデックスを指している

エラーは次のとおりです。 InvalidArgumentError (see above for traceback): label SparseTensor is not valid: indices[1] = [1,0] is out of bounds: need 0 <= index < [1,9] [[Node: CTCLoss = CTCLoss[ctc_merge_repeated=true, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](transpose_1, _recv_targets/indices_0, _recv_targets/values_0, _recv_sequence_length_0)]]

これに対する解決策を見つけることができません。私の次元や他の何かのエラーを作ったのですか?

プログラムのためのコードはここにある: https://github.com/shardulparab97/Speech-Recog/blob/master/model2.py

  • input_valの大きさである(1,9,13)
  • CTC関数への入力を与える機能sparse_tuple_fromは:

def sparse_tuple_from(sequences, dtype=np.int32): #Create a sparse representention of x. #Args: # sequences: a list of lists of type dtype where each element is a #sequence #Returns: # A tuple with (indices, values, shape) # indices = [] values = [] #print ("SEQUENCES IN FUNCTION:",sequences) for n, seq in enumerate(sequences): indices.extend(zip([n] * len(matrix(seq)), range(len(matrix(seq))))) values.extend([seq]) indices = np.asarray(indices, dtype=np.int32) values = np.asarray(values, dtype=dtype) shape = np.asarray([len(sequences), np.asarray(indices).max(0)[1] + 1], dtype=np.int32) return indices, values, shape

答えて

0

私はmaxtimestepsを変更、同じ質問を満たし、かつworks.Soは、あなたがCHAすべきことあなたのタイムステップをより大きな数字に変更してください。

関連する問題