Skip to content

Commit 13519e5

Browse files
committed
fix _test_model_inference
1 parent ac4e214 commit 13519e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bioimageio/core/resource_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from bioimageio.spec import __version__ as bioimageio_spec_version
2626
from bioimageio.spec.model.raw_nodes import WeightsFormat
2727
from bioimageio.spec.shared import resolve_source
28+
from bioimageio.spec.shared.common import ValidationWarning
2829
from bioimageio.spec.shared.raw_nodes import ResourceDescription as RawResourceDescription
2930

3031

@@ -126,6 +127,8 @@ def _test_model_documentation(rd: ResourceDescription) -> TestSummary:
126127

127128

128129
def _test_model_inference(model: Model, weight_format: str, devices: Optional[List[str]], decimal: int) -> TestSummary:
130+
error: Optional[str] = None
131+
tb: Optional = None
129132
with warnings.catch_warnings(record=True) as all_warnings:
130133
try:
131134
inputs = [np.load(str(in_path)) for in_path in model.test_inputs]
@@ -175,7 +178,7 @@ def _test_model_inference(model: Model, weight_format: str, devices: Optional[Li
175178
traceback=tb,
176179
bioimageio_spec_version=bioimageio_spec_version,
177180
bioimageio_core_version=bioimageio_core_version,
178-
warnings={},
181+
warnings=ValidationWarning.get_warning_summary(all_warnings),
179182
source_name=model.id or model.name,
180183
)
181184

0 commit comments

Comments
 (0)