Skip to content

Commit 3d0897c

Browse files
authored
Merge pull request #726 from bioimage-io/dev
add weights.onnx.external_data
2 parents 38092b7 + 75cdf10 commit 3d0897c

File tree

4 files changed

+47
-10
lines changed

4 files changed

+47
-10
lines changed

changelog.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ In this file we log both:
1010

1111
This changelog includes implementation details and my reference the [changes to the Resource Description Format](#changes-to-the-resource-description-format), e.g. in entry [bioimageio.spec 0.5.2](#bioimageiospec-052).
1212

13+
#### bioimageio.spec 0.5.6.0
14+
15+
- [model format 0.5.6](#model-056)
16+
1317
#### bioimageio.spec 0.5.5.7
1418

1519
- Fix `ValidationSummary.add_detail()` (respect 'valid-format' status)
@@ -42,7 +46,7 @@ This changelog includes implementation details and my reference the [changes to
4246

4347
#### bioimageio.spec 0.5.5.0
4448

45-
- added programmatic `uplaod` (alpha stage)
49+
- added programmatic `upload` (alpha stage)
4650
- [generic format 0.3.2 and model format 0.5.5](#generic-032-and-model-055)
4751

4852
#### bioimageio.spec 0.5.4.4
@@ -330,6 +334,11 @@ Here is a list of changes for each `type` and `format_version`.
330334
Note that 'generic' changes apply to `type` application, dataset and notebook of the same `format_versions`.
331335
If the changes also apply to `type` model, the coresponding model format version is noted, e.g. [generic 0.3.1 and model 0.5.3](#generic-031-and-model-053).
332336

337+
#### model 0.5.6
338+
339+
- Non-breaking changes:
340+
- New optional `weights.onnx.external_data` field to allow for (large) ONNX models split into an architecture and an external data (weights) file.
341+
333342
#### generic 0.3.2 and model 0.5.5
334343

335344
- Non-breaking changes:

src/bioimageio/spec/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.5.5.7"
1+
VERSION = "0.5.6.0"

src/bioimageio/spec/model/v0_5.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,12 +2359,23 @@ class KerasHdf5WeightsDescr(WeightsEntryDescrBase):
23592359
"""TensorFlow version used to create these weights."""
23602360

23612361

2362+
FileDescr_external_data = Annotated[
2363+
FileDescr_,
2364+
WithSuffix(".data", case_sensitive=True),
2365+
Field(examples=[dict(source="weights.onnx.data")]),
2366+
]
2367+
2368+
23622369
class OnnxWeightsDescr(WeightsEntryDescrBase):
23632370
type = "onnx"
23642371
weights_format_name: ClassVar[str] = "ONNX"
23652372
opset_version: Annotated[int, Ge(7)]
23662373
"""ONNX opset version"""
23672374

2375+
external_data: Optional[FileDescr_external_data] = None
2376+
"""Source of the external ONNX data file holding the weights.
2377+
(If present **source** holds the ONNX architecture without weights)."""
2378+
23682379

23692380
class PytorchStateDictWeightsDescr(WeightsEntryDescrBase):
23702381
type = "pytorch_state_dict"
@@ -2611,11 +2622,11 @@ class ModelDescr(GenericModelDescrBase):
26112622
These fields are typically stored in a YAML file which we call a model resource description file (model RDF).
26122623
"""
26132624

2614-
implemented_format_version: ClassVar[Literal["0.5.5"]] = "0.5.5"
2625+
implemented_format_version: ClassVar[Literal["0.5.6"]] = "0.5.6"
26152626
if TYPE_CHECKING:
2616-
format_version: Literal["0.5.5"] = "0.5.5"
2627+
format_version: Literal["0.5.6"] = "0.5.6"
26172628
else:
2618-
format_version: Literal["0.5.5"]
2629+
format_version: Literal["0.5.6"]
26192630
"""Version of the bioimage.io model description specification used.
26202631
When creating a new model always use the latest micro/patch version described here.
26212632
The `format_version` is important for any consumer software to understand how to parse the fields.
@@ -3357,7 +3368,7 @@ def conv_authors(auths: Optional[Sequence[_Author_v0_4]]):
33573368
covers=src.covers,
33583369
description=src.description,
33593370
documentation=src.documentation,
3360-
format_version="0.5.5",
3371+
format_version="0.5.6",
33613372
git_repo=src.git_repo, # pyright: ignore[reportArgumentType]
33623373
icon=src.icon,
33633374
id=None if src.id is None else ModelId(src.id),

src/bioimageio/spec/static/bioimageio_schema.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10528,7 +10528,7 @@
1052810528
"title": "Version Comment"
1052910529
},
1053010530
"format_version": {
10531-
"const": "0.5.5",
10531+
"const": "0.5.6",
1053210532
"description": "Version of the bioimage.io model description specification used.\nWhen creating a new model always use the latest micro/patch version described here.\nThe `format_version` is important for any consumer software to understand how to parse the fields.",
1053310533
"title": "Format Version",
1053410534
"type": "string"
@@ -10677,7 +10677,7 @@
1067710677
"outputs",
1067810678
"weights"
1067910679
],
10680-
"title": "model 0.5.5",
10680+
"title": "model 0.5.6",
1068110681
"type": "object"
1068210682
},
1068310683
"bioimageio__spec__model__v0_5__OnnxWeightsDescr": {
@@ -10773,6 +10773,23 @@
1077310773
"minimum": 7,
1077410774
"title": "Opset Version",
1077510775
"type": "integer"
10776+
},
10777+
"external_data": {
10778+
"anyOf": [
10779+
{
10780+
"$ref": "#/$defs/FileDescr",
10781+
"examples": [
10782+
{
10783+
"source": "weights.onnx.data"
10784+
}
10785+
]
10786+
},
10787+
{
10788+
"type": "null"
10789+
}
10790+
],
10791+
"default": null,
10792+
"description": "Source of the external ONNX data file holding the weights.\n(If present **source** holds the ONNX architecture without weights)."
1077610793
}
1077710794
},
1077810795
"required": [
@@ -13892,7 +13909,7 @@
1389213909
"discriminator": {
1389313910
"mapping": {
1389413911
"0.4.10": "#/$defs/bioimageio__spec__model__v0_4__ModelDescr",
13895-
"0.5.5": "#/$defs/bioimageio__spec__model__v0_5__ModelDescr"
13912+
"0.5.6": "#/$defs/bioimageio__spec__model__v0_5__ModelDescr"
1389613913
},
1389713914
"propertyName": "format_version"
1389813915
},
@@ -13976,7 +13993,7 @@
1397613993
"discriminator": {
1397713994
"mapping": {
1397813995
"0.4.10": "#/$defs/bioimageio__spec__model__v0_4__ModelDescr",
13979-
"0.5.5": "#/$defs/bioimageio__spec__model__v0_5__ModelDescr"
13996+
"0.5.6": "#/$defs/bioimageio__spec__model__v0_5__ModelDescr"
1398013997
},
1398113998
"propertyName": "format_version"
1398213999
},

0 commit comments

Comments
 (0)