Tensorflow:使用'tf.contrib.metrics.streaming\u mean\u iou'时出现错误`
当试图使用tensorflowsTensorflow:使用'tf.contrib.metrics.streaming\u mean\u iou'时出现错误`,tensorflow,Tensorflow,当试图使用tensorflowstf.contrib.metrics.streaming\u mean\u iou计算联合上的交集时,我遇到了一个奇怪的错误 这是我以前使用的代码,它工作得非常好 tensorflow as tf label = tf.image.decode_png(tf.read_file('/path/to/label.png'),channels=1) label_lin = tf.reshape(label, [-1,]) weights = tf.cast(tf.le
tf.contrib.metrics.streaming\u mean\u iou
计算联合上的交集时,我遇到了一个奇怪的错误这是我以前使用的代码,它工作得非常好
tensorflow as tf
label = tf.image.decode_png(tf.read_file('/path/to/label.png'),channels=1)
label_lin = tf.reshape(label, [-1,])
weights = tf.cast(tf.less_equal(label_lin, 10), tf.int32)
mIoU, update_op = tf.contrib.metrics.streaming_mean_iou(label_lin, label_lin,num_classes = 11,weights = weights)
init = tf.local_variables_initializer()
sess.run(init)
sess.run([update_op])
但是当我用这样的面具的时候
mask = tf.image.decode_png(tf.read_file('/path/to/mask_file.png'),channels=1)
mask_lin = tf.reshape(mask, [-1,])
mask_lin = tf.cast(mask_lin,tf.int32)
mIoU, update_op = tf.contrib.metrics.streaming_mean_iou(label_lin, label_lin,num_classes = 11,weights = mask_lin)
init = tf.local_variables_initializer()
sess.run(init)
sess.run([update_op])
在显示此错误的不规则迭代次数后,它继续失败:
*** Error in `/usr/bin/python': corrupted double-linked list: 0x00007f29d0022fd0 ***
我检查了mask_lin
和weights
的形状和数据类型。它们是一样的,所以我真的看不出这里出了什么问题。另外,调用
update\u op
不规则次数后出现错误的事实也很奇怪。也许TF会在调用几个sess.run()
之后清空mask\u lin
对象或者这是某种TF错误?但是,为什么它会与
权重
一起工作呢?这听起来像TensorFlow bug。请填写如何重现问题的详细信息,然后有人会看一看。看起来您将其发布为。。。谢谢