I’m not completely sure how the output shape of your model ([batch_size=64, nb_classes=256]) fits a binary classification use case.
If you want to transform your current use case from a multi-class classification with 256 classes to a binary classification, the model output would be [64, 1] and the target would have the same shape.
However, since the model output already doesn’t match a binary classification, are you maybe working on a multi-label classification, which would allow each sample to belong to zero, one, or multiple classes? In that case, the target should also have the same shape as the model output, i.e. [64, 256].