我有一个Tensor对象 dataset_tf ,具有以下规范:
Tensor("loss/dense_7_loss/Const:0", shape=(214, 9), dtype=float64)
我想在该对象中找到 y 占位符对象的索引:
Tensor("dense_7_target:0", shape=(?, 9), dtype=float32)
我用 tf.where 来找到上一行的索引:
index=tf.where(tf.equal(dataset_tf, y))
当我想通过此索引访问行
row=dataset_tf[index,:]
我看到以下错误消息:
ValueError: Shapes must be equal rank, but are 2 and 0
From merging shape 0 with other shapes. for 'loss/dense_7_loss/strided_slice/stack_1' (op: 'Pack') with input shapes: [?,2], [].