由于形状为“无”,因此无法进一步处理。在one_hot编码后,我需要完整的形状。
labels = [0, 0, 0, 0, 0, 0, 0, 1]
one_hot_labels = tf.one_hot(labels,5)
返回哪个
<tf.Tensor 'one_hot:0' shape=(?, 5) dtype=float32>)
这会导致值错误
ValueError: All shapes must be fully defined:
TensorShape([Dimension(None), Dimension(5)])