Skip to content

Commit 078908f

Browse files
committed
🐛 Fix errors related to new design.
1 parent a93ee0c commit 078908f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/models/test_patch_predictor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ def test_patch_predictor_kather100k_output(
10251025
pretrained_model,
10261026
probabilities_check=expected_prob,
10271027
predictions_check=[6, 3],
1028-
on_gpu=ON_GPU,
1028+
device=select_device(on_gpu=ON_GPU),
10291029
)
10301030
# only test 1 on travis to limit runtime
10311031
if toolbox_env.running_on_ci():
@@ -1060,7 +1060,7 @@ def test_patch_predictor_pcam_output(sample_patch3: Path, sample_patch4: Path) -
10601060
pretrained_model,
10611061
probabilities_check=expected_prob,
10621062
predictions_check=[1, 0],
1063-
on_gpu=ON_GPU,
1063+
device=select_device(on_gpu=ON_GPU),
10641064
)
10651065
# only test 1 on travis to limit runtime
10661066
if toolbox_env.running_on_ci():

tests/models/test_semantic_segmentation.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def test_functional_segmentor(
552552
output_list = semantic_segmentor.predict(
553553
file_list,
554554
mode="tile",
555-
on_gpu=ON_GPU,
555+
device=select_device(on_gpu=ON_GPU),
556556
ioconfig=ioconfig,
557557
crash_on_exception=True,
558558
save_dir=f"{save_dir}/raw/",
@@ -581,7 +581,7 @@ def test_functional_segmentor(
581581
[mini_wsi_svs],
582582
masks=[mini_wsi_msk],
583583
mode="wsi",
584-
on_gpu=ON_GPU,
584+
device=select_device(on_gpu=ON_GPU),
585585
ioconfig=ioconfig,
586586
crash_on_exception=True,
587587
save_dir=f"{save_dir}/raw/",
@@ -605,7 +605,7 @@ def test_functional_segmentor(
605605
[mini_wsi_svs],
606606
masks=[mini_wsi_msk],
607607
mode="wsi",
608-
on_gpu=ON_GPU,
608+
device=select_device(on_gpu=ON_GPU),
609609
ioconfig=ioconfig,
610610
crash_on_exception=True,
611611
save_dir=f"{save_dir}/raw/",
@@ -631,7 +631,7 @@ def __init__(self: XSegmentor) -> None:
631631
semantic_segmentor.predict(
632632
[mini_wsi_jpg],
633633
mode="tile",
634-
on_gpu=ON_GPU,
634+
device=select_device(on_gpu=ON_GPU),
635635
patch_input_shape=(1024, 1024),
636636
patch_output_shape=(512, 512),
637637
stride_shape=(256, 256),
@@ -661,7 +661,7 @@ def test_functional_pretrained(remote_sample: Callable, tmp_path: Path) -> None:
661661
semantic_segmentor.predict(
662662
[mini_wsi_svs],
663663
mode="wsi",
664-
on_gpu=ON_GPU,
664+
device=select_device(on_gpu=ON_GPU),
665665
crash_on_exception=True,
666666
save_dir=f"{save_dir}/raw/",
667667
)
@@ -672,7 +672,7 @@ def test_functional_pretrained(remote_sample: Callable, tmp_path: Path) -> None:
672672
semantic_segmentor.predict(
673673
[mini_wsi_jpg],
674674
mode="tile",
675-
on_gpu=ON_GPU,
675+
device=select_device(on_gpu=ON_GPU),
676676
crash_on_exception=True,
677677
save_dir=f"{save_dir}/raw/",
678678
)
@@ -699,7 +699,7 @@ def test_behavior_tissue_mask_local(remote_sample: Callable, tmp_path: Path) ->
699699
semantic_segmentor.predict(
700700
[wsi_with_artifacts],
701701
mode="wsi",
702-
on_gpu=True,
702+
device=select_device(on_gpu=ON_GPU),
703703
crash_on_exception=True,
704704
save_dir=save_dir / "raw",
705705
)
@@ -715,7 +715,7 @@ def test_behavior_tissue_mask_local(remote_sample: Callable, tmp_path: Path) ->
715715
semantic_segmentor.predict(
716716
[mini_wsi_jpg],
717717
mode="tile",
718-
on_gpu=True,
718+
device=select_device(on_gpu=ON_GPU),
719719
crash_on_exception=True,
720720
save_dir=f"{save_dir}/raw/",
721721
)
@@ -738,7 +738,7 @@ def test_behavior_bcss_local(remote_sample: Callable, tmp_path: Path) -> None:
738738
semantic_segmentor.predict(
739739
[wsi_breast],
740740
mode="wsi",
741-
on_gpu=True,
741+
device=select_device(on_gpu=ON_GPU),
742742
crash_on_exception=True,
743743
save_dir=save_dir / "raw",
744744
)

0 commit comments

Comments
 (0)