try delete torch.cuda.empty_cache()
torch.cuda.empty_cache()
seems to be ok because I run in subprocess.