Код: Выделить всё
def generate_sequence(self, input_data):
predicted_sequence = tf.convert_to_tensor(input_data, dtype=tf.float32)
data_shape = predicted_sequence.shape
for i in range(len(predicted_sequence)):
model_input = tf.reshape(predicted_sequence, shape=data_shape)
result = self.model(model_input)
predicted_sequence = tf.concat([predicted_sequence[:, 1:, :], result], 0)
return predicted_sequence
Код: Выделить всё
ConcatOp : Dimension 1 in both shapes must be equal: shape[0] = [1,1439,4] vs. shape[1] = [1,1,4] [Op:ConcatV2] name: concatКод: Выделить всё
[[[a1, b1, c1, d1]
[a2, b2, c2, d2]
...
[aN, bN, cN, dN]]
Код: Выделить всё
[[aP1, bP1, cP1, dP1]]
Код: Выделить всё
[[[a2, b2, c2, b2]
[a3, b3, c3, d3]
...
[aN, bN, cN, dN]
[aP1, bP1, cP1, dP1]]]
Есть ли другой метод тензорного потока, который лучше подходит для этого или я что-то упускаю в методе tf.concat?
Буду очень признателен за любую помощь.
Подробнее здесь: https://stackoverflow.com/questions/783 ... tensorflow