It seems your batch size is smaller than nb_cat, thus the split_size is 0.
This might be the case if you set a smaller batch_size in your DataLoader or alternatively the last batch in the training loop might be smaller, if the number of samples is not divisible by the batch size without a remainder. You could avoid this issue if you set drop_last=True in your DataLoader (or handle the smaller batch in another way).