A multi-label classification is used if each sample can belong to zero, one, or multiple classes.
For this to work, the output tensor of the model as well as the target should have the shape [batch_size, nb_classes]. In your current example of the target tensor it seems that it’s using a variable shape, which won’t work, as it should contain the target values for each class.
Assuming you are working with 18 classes, both tensors are expected to have the shape [batch_size, 18], where the target contains values in [0, 1] for each class.