Skip to content
RED SAGSkills
medium10 pts · first answer countsgpu-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