我正在下面这个 tutorial和我做,因为tensorflow更新的一些变化后,我得到这个错误:TensorFlow错误:“logits和标签必须是相同的大小”,warmspringwinds“教程”
tensorflow.python.framework.errors_impl.InvalidArgumentError: logits and labels must be same size: logits_size=[399360,2] labels_size=[409920,2] [[Node: SoftmaxCrossEntropyWithLogits = SoftmaxCrossEntropyWithLogits[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape_2, Reshape_3)]].
任何人都可以帮我解决这个问题吗?
变化代码:
#Replaced concat_dim=2 with axis=2
combined_mask = tf.concat(axis=2, values=[bit_mask_class, bit_mask_background])
#Update the import of urllib2 to urllib3
#Replace tf.pack with tf.stack
upsampled_logits_shape = tf.stack([
downsampled_logits_shape[0],
downsampled_logits_shape[1] * upsample_factor,
downsampled_logits_shape[2] * upsample_factor,
downsampled_logits_shape[3]])
我更新了帖子 – cat96