Skip to content

Commit

Permalink
Update device to be cuda:0
Browse files Browse the repository at this point in the history
  • Loading branch information
lmanan committed Feb 27, 2024
1 parent b29dce7 commit f452785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/examples/2d/02-train.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# We set the `max_iterations` equal to 5000 for demonstration purposes.
# <br>(This takes around 20 minutes on a Mac Book Pro with an Apple M2 Max chip).

device = "mps" # 'mps', 'cpu', 'cuda:0'
device = "cuda:0" # 'mps', 'cpu', 'cuda:0'
max_iterations = 5000

train_config = TrainConfig(
Expand All @@ -62,5 +62,6 @@
# Now we can begin the training! <br>
# Uncomment the next two lines to train the model.

# +
# from cellulus.train import train
# train(experiment_config)
5 changes: 1 addition & 4 deletions docs/examples/2d/03-infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# <br> The device could be set equal to `cuda:n` (where `n` is the index of
# the GPU, for e.g. `cuda:0`), `cpu` or `mps`.

device = "mps" # "cuda:0", 'mps', 'cpu'
device = "cuda:0" # "cuda:0", 'mps', 'cpu'

# We initialize the `inference_config` which contains our
# `embeddings_dataset_config`, `segmentation_dataset_config` and
Expand All @@ -91,7 +91,6 @@
# would like the cell membrane to be segmented or the nucleus.

post_processing = "nucleus"
bandwidth = 15.0

inference_config = InferenceConfig(
dataset_config=asdict(dataset_config),
Expand All @@ -100,7 +99,6 @@
post_processed_dataset_config=asdict(post_processed_dataset_config),
post_processing=post_processing,
device=device,
bandwidth=bandwidth,
)

# ## Initialize `experiment_config`
Expand Down Expand Up @@ -180,4 +178,3 @@
bottom_left_cmap=new_cmp,
bottom_right_cmap=new_cmp,
)
# -

0 comments on commit f452785

Please sign in to comment.