I see some issues (or are they intentional ?) in the codes:

The metrics (accuracy and F1) and loss is calculated after the loop is completed and it seems only the last iteration is used for calculation.
Although, the outputs is converted to int, it is does a ceil operation and unless the prediction is exactly equal to 1, the prediction is almost always 0.
Accuracy-score for multi-label maybe not the right choice as it requires matching all the labels (all 18) with the all the predictions. Hamming-loss which says how many labels are incorrectly predicted maybe a better choice. But this maybe a choice which you would want to take.