ValueError: Dimensions must be equal, but are 16 and 28 for 'activation_2/p_re_lu_l/mul' (op: 'Mul')

时间:2017-10-23 00:29:32

标签: python tensorflow keras activation-function

i'm Lee. I have a question about image recognition. The code i use now quotes the code uploaded to github of brendan fortuner. I usaed a PReLU activation function, which seems to have a problem in this part. I tried to solve it, but it's not working so i'm going to get you a hint about solving the problem. please give me a hint about on problem solving.

During the running of the model, the following error occurs:

ValueError: Dimensions must be equal, but 16 and 28 for 'activation_2/p_re_lu_l/mul' (op : Mul) with input shape [32,32,16], [?,32,32,28].

1 个答案:

答案 0 :(得分:0)

错误表示您尝试连接的图层 s 的输出节点数和输入节点数不一致。你可以

将[32,32, 16 ]更改为[32,32, 28 ]

将[32,32, 28 ]更改为[32,32, 16 ]

取决于输入图像的形状(如果这两个图层中的任何一个是输入图层)。