我正在处理自定义损失函数,并且得到的y_pred的形状与摘要中的输出不同
conv2d_100 (Conv2D) (None, 3, 360, 512) 85 leaky_re_lu_27[0][0]
==================================================================================================
Total params: 4,128,849
Trainable params: 4,119,761
Non-trainable params: 9,088
__________________________________________________________________________________________________
这是我得到的输出:
Defining loss function
y_true [None, None, None]
y_pred [None, 3, None, 512]
代码是这样的:
def focal_loss(content, label_remap, gamma_=2, w_d=1e-4):
def focal_loss_fixed(y_true, y_pred):
num_classes = len(content.keys())
print("y_true_b", y_true.get_shape().as_list())
cv_eqation = K.constant([0.114, 0.587, 0.299])
y_true = tf.multiply(y_true, cv_eqation)
y_true = tf.reduce_sum(y_true, axis=3)
y_true = tf.cast(y_true, dtype=tf.uint8)
print("Defining loss function")
print("y_true", y_true.get_shape().as_list())
print("y_pred", y_pred.get_shape().as_list())
.
.
return loss
return focal_loss_fixed
那么,为什么我没有没有,而不是输出的高点?