oyly commited on
Commit
218c3da
·
1 Parent(s): be4b2be

empty cuda cache

Browse files
Files changed (1) hide show
  1. flux/sampling_lore.py +3 -1
flux/sampling_lore.py CHANGED
@@ -348,7 +348,9 @@ def denoise_with_noise_optim(
348
  trainable_noise.grad *= source_mask[0]
349
  optimizer.step()
350
  print(f"Time {t_curr:.4f} Step {j+1}/{training_epochs}, Loss: {total_loss.item():.6f}")
351
-
 
 
352
  step_list.append(t_curr)
353
  trainable_noise = trainable_noise.detach()
354
  trainable_noise_list.append(trainable_noise.clone())
 
348
  trainable_noise.grad *= source_mask[0]
349
  optimizer.step()
350
  print(f"Time {t_curr:.4f} Step {j+1}/{training_epochs}, Loss: {total_loss.item():.6f}")
351
+ torch.cuda.empty_cache()
352
+ torch.cuda.synchronize()
353
+
354
  step_list.append(t_curr)
355
  trainable_noise = trainable_noise.detach()
356
  trainable_noise_list.append(trainable_noise.clone())