Solved by shwe87 in post #3 
              
              
                No, actually I figured it out. 
my batch size = 32. 
The last batch wasn’t 32 and was 12, that’s why. I just pass when it an incomplete batch and it worked