I am using the MXNet backend of Keras to train the Isensee segmentation network found here: https://github.com/ellisdg/3DUnetCNN/blob/master/unet3d/model/isensee2017.py.
Since I have 7 classes, I want to apply the softmax activation in the output layer, but I get the following error:
RuntimeError: simple_bind error. Arguments: /input_11: (8, 1, 64, 64, 64) /softmax_1_target1: (8, 7, 64, 64, 64) /softmax_1_sample_weights1: (8,) Error in operator broadcast_mul14: [16:48:16] c:\jenkins\workspace\mxnet-tag\mxnet\src\operator\tensor\./elemwise_binary_broadcast_op.h:68: Check failed: l == 1 || r == 1: operands could not be broadcast together with shapes [8,7,64,64] 
input_shape is (1,64,64,64) and
n_labels is 7. I have tried several options, all with the same result:
activation_block = Activation(activation_name)(output_layer)
activation_block = Conv3D(n_labels, kernel_size=(1,1,1), activation="softmax")(output_layer)
activation_block = Softmax(axis=1)(output_layer)
where the shape of the output_layer is (None, 7, 64, 64, 64).
activation_name to “sigmoid” does work, but seems less logical to me since I have a multiclass problem.
Is this a bug or am I doing something wrong?