Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow:使用'tf.contrib.metrics.streaming\u mean\u iou'时出现错误`_Tensorflow - Fatal编程技术网

Tensorflow:使用'tf.contrib.metrics.streaming\u mean\u iou'时出现错误`

Tensorflow:使用'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

当试图使用tensorflows
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。请填写如何重现问题的详细信息,然后有人会看一看。看起来您将其发布为。。。谢谢