Skip to content

Commit 6346911

Browse files
authored
Remove explicit, manual memory freeing between batches on GPU
Minor performance improvement, no new memory issues
1 parent 4fa42a6 commit 6346911

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

torch_mesmer/mesmer.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,6 @@ def predict(self,
190190

191191
# Move predictions back to CPU to save GPU memory
192192
output_tiles[tile_batch_start:tile_batch_start+batch_size] = pred.cpu()
193-
194-
# Clean up GPU memory
195-
del tile_batch, pred
196-
if self.device != 'cpu':
197-
torch.cuda.empty_cache()
198-
199193

200194
# Untile images
201195
output_images = untile_output(output_tiles, tiles_info)

0 commit comments

Comments
 (0)