2017-10-29 4 views
1

の予想型と一致しないのfloat32型を持つ、そして次の行でエラーが発生しましたのインプット「split_dim」:TensorFlowバージョン1.3.0 - 「スプリット」OPは私が<a href="https://github.com/guillaume-chevalier/LSTM-Human-Activity-Recognition" rel="nofollow noreferrer">github</a>からコードを実行しているのint32

# Split the series because the rnn cell needs time_steps features, each of shape: 
hidden = tf.split(0, config.n_steps, feature_mat) 
print (len(hidden), str(hidden[0].get_shape())) 
# New shape: a list of lenght "time_step" containing tensors of shape [batch_size, n_hidden] 

エラーメッセージは次のとおりです。

TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

私はStackOverflowの上で同様の質問を見ていると、問題がtensorflowの古いバージョンから生じたが、tensorflowの私のバージョンは1.3です。

+0

[this](https://stackoverflow.com/a/41868500/5200287)の回答が示唆しているように、「feature_mat」と「0」を入れ替えてみましたか? – gommb

+0

はい、これは非常に役に立ちます!ありがとう! – user97t9q8w98r55203

答えて

0

実際には、これは、tf.splitの古いバージョンを使用しているためです。次のようにコードを修正してください。

+0

ありがとうございました!コードは完全に今実行されます。 – user97t9q8w98r55203

関連する問題

 関連する問題