【发布时间】:2016-10-08 08:51:38
【问题描述】:
我想跳过一些具有特定标签的数据(例如 if label >= 7 或其他)。我的代码在这里:
true = tf.constant(True)
less_op = tf.less(label, tf.constant(delimiter))
label = tf.cast(
tf.slice(record_bytes, [0], [label_bytes]), tf.int32)
tf.cond(less_op, lambda: true, lambda: true)
在第 4 行我有错误:ValueError: Shapes (1,) and () are not compatible。我假设它是由less_op 引起的(如果我用true 代码代替它)。我还调查了label 存在一些问题:代码less_op = tf.less(tf.constant(1), tf.constant(delimiter)) 完美运行。
【问题讨论】:
标签: python-3.x tensorflow