1
- import os
1
+ from marshmallow import missing
2
+
2
3
import bioimageio .spec as spec
3
4
from bioimageio .core import load_raw_resource_description , load_resource_description
4
5
from bioimageio .core .resource_io import nodes
5
6
from bioimageio .core .resource_io .utils import resolve_source
6
7
from bioimageio .core .resource_tests import test_model as _test_model
7
- from marshmallow import missing
8
8
9
9
10
10
def _test_build_spec (
@@ -16,7 +16,6 @@ def _test_build_spec(
16
16
use_implicit_output_shape = False ,
17
17
add_deepimagej_config = False ,
18
18
use_original_covers = False ,
19
- use_absoloute_arch_path = False ,
20
19
training_data = None ,
21
20
parent = None ,
22
21
):
@@ -44,11 +43,6 @@ def _test_build_spec(
44
43
if weight_type == "pytorch_state_dict" :
45
44
model_kwargs = None if weight_spec .kwargs is missing else weight_spec .kwargs
46
45
architecture = str (weight_spec .architecture )
47
- if use_absoloute_arch_path :
48
- arch_path , cls_name = architecture .split (":" )
49
- arch_path = os .path .abspath (os .path .join (root , arch_path ))
50
- assert os .path .exists (arch_path )
51
- architecture = f"{ arch_path } :{ cls_name } "
52
46
weight_type_ = None # the weight type can be auto-detected
53
47
elif weight_type == "torchscript" :
54
48
architecture = None
@@ -233,10 +227,3 @@ def test_build_spec_deepimagej_keras(unet2d_keras, tmp_path):
233
227
# test with original covers
234
228
def test_build_spec_with_original_covers (unet2d_nuclei_broad_model , tmp_path ):
235
229
_test_build_spec (unet2d_nuclei_broad_model , tmp_path / "model.zip" , "torchscript" , use_original_covers = True )
236
-
237
-
238
- # test with absolute path for the architecture file
239
- def test_build_spec_abs_arch_path (unet2d_nuclei_broad_model , tmp_path ):
240
- _test_build_spec (
241
- unet2d_nuclei_broad_model , tmp_path / "model.zip" , "pytorch_state_dict" , use_absoloute_arch_path = True
242
- )
0 commit comments