Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cell_segmentation/run_cpp_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import inspect
import os
import sys
import torch
import gc

currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
Expand Down Expand Up @@ -36,6 +38,9 @@
default_conf=configuration, checkpoint=configuration["checkpoint"]
)
outdir = experiment.run_experiment()
del experiment
gc.collect()
torch.cuda.empty_cache()
inference = InferenceCellViTCPP(
run_dir=outdir,
gpu=configuration["gpu"],
Expand Down Expand Up @@ -76,6 +81,9 @@
else:
# casual run
outdir = experiment.run_experiment()
del experiment
gc.collect()
torch.cuda.empty_cache()
inference = InferenceCellViTCPP(
run_dir=outdir,
gpu=configuration["gpu"],
Expand Down