Multiprocessing - Barrier Blocks all Processes?

If i change the code so both have the same number of epochs in the for loop, then it works