1
這裏的代碼:Tensorflow tf.split()列表索引超出範圍?
a = tf.constant([1,2,3,4])
b = tf.constant([4])
c = tf.split(a, tf.squeeze(b))
那麼,事實證明是錯誤的:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jeff/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1203, in split
num = size_splits_shape.dims[0]
IndexError: list index out of range
但是,爲什麼?
感謝您的回答,但是如何將其分成4個部分? –
'tf.split(a,4)',不包含張量中的數字。 – user1735003