I am trying to convert my networks in keras (tensorflow backend) to mxnet backend.
What confused me is when I use gluon.utils.metrics.segmentation.batch_intersection_union to calculate MIoU in the Semantic Segmentation task as follow:
def MIoU(y_true, y_pred, nb_classes= args.nb_classes): area_inter, area_union = batch_intersection_union(y_pred, y_true, nclass= nb_classes) miou = K.cast(area_inter / area_union, dtype=np.float32) return K.cast(miou/nb_classes, dtype=np.float32)
the error is:
AttributeError: ‘KerasSymbol’ object has no attribute ‘asnumpy’ .
What does it means and how to solve this problem?
Any help would be appreciated. Thanks in advance.