thanks! But I still don’t quite understand why this happened. First, I called the torch.cuda.empty_cache(). Does this method free the unnecessary memory? Second, the out of memory happened in the second iteration, not in the test phase. Best!