Skip to content
RED SAG Skills
mediumStudy question · answer published in PyTorch interview questions, so no pointsgpu-computinggpu-memorypytorch

Memory grows each training step

GPU memory rises every step until OOM. Which line is the likely cause?

total = 0
for x, y in loader:
    loss = loss_fn(model(x), y)
    loss.backward()
    opt.step(); opt.zero_grad()
    total += loss
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions