Program stuck trying to print torchvision.ops.roi_align

I’m use print to debug my faster r-cnn model and make some control points. First epoch doesn’t make any problem. All work. But when start 2-nd epoch model stuck trying to print roi alight output. It doesn’t raise any error or masseges, doesn’t stop code execution. And after very long time it’s continue without any trouble and next epochs there is no problem again. What could be the reason for this?

I forgot to mention that when using torchvision.ops.roi_pool there are no learning problems

Edit 2: I noticed, that sometimes it doesn’t take much time, but most of the time learning just doesn’t go on