Thank you for the response.
I have detached the tensor as follows but unfortunately and the memory usage doesn’t solve.
Do you see any other potential mistakes? ~
Would it be possible if it is caused by the use of iteration tool?
lfw_loader = itertools.cycle(lfw_loader)

        loss += loss_batch.detach()
        logger(loss.detach(), metrics, batch_idx)
        # if show_running:
        #    logger(loss.detach(), metrics, batch_idx)
        # else:
        #    logger(loss_batch.detach(), metrics_batch, batch_idx)
            
        gc.collect()