|
10 | 10 | },
|
11 | 11 | {
|
12 | 12 | "cell_type": "code",
|
13 |
| - "execution_count": 1, |
| 13 | + "execution_count": null, |
14 | 14 | "id": "c72ba149",
|
15 | 15 | "metadata": {},
|
16 |
| - "outputs": [ |
17 |
| - { |
18 |
| - "name": "stderr", |
19 |
| - "output_type": "stream", |
20 |
| - "text": [ |
21 |
| - "/home/pape/Work/bioimageio/spec-bioimage-io/bioimageio/spec/shared/_resolve_source.py:326: UserWarning: found cached /tmp/bioimageio_cache/https/raw.githubusercontent.com/bioimage-io/bioimage.io/main/site.config.json. Skipping download of https://raw.githubusercontent.com/bioimage-io/bioimage.io/main/site.config.json.\n", |
22 |
| - " warnings.warn(f\"found cached {local_path}. Skipping download of {uri}.\")\n" |
23 |
| - ] |
24 |
| - } |
25 |
| - ], |
| 16 | + "outputs": [], |
26 | 17 | "source": [
|
27 | 18 | "import os\n",
|
28 | 19 | "import hashlib\n",
|
|
39 | 30 | },
|
40 | 31 | {
|
41 | 32 | "cell_type": "code",
|
42 |
| - "execution_count": 2, |
| 33 | + "execution_count": null, |
43 | 34 | "id": "74613461",
|
44 | 35 | "metadata": {},
|
45 | 36 | "outputs": [],
|
|
69 | 60 | },
|
70 | 61 | {
|
71 | 62 | "cell_type": "code",
|
72 |
| - "execution_count": 6, |
| 63 | + "execution_count": null, |
73 | 64 | "id": "2de51dae",
|
74 | 65 | "metadata": {},
|
75 | 66 | "outputs": [],
|
76 | 67 | "source": [
|
77 | 68 | "# the model can be loaded using different representations:\n",
|
78 | 69 | "\n",
|
79 | 70 | "# the doi of the zenodo entry corresponding to the model\n",
|
80 |
| - "rdf_doi = \"10.5281/zenodo.6028056\"\n", |
| 71 | + "rdf_doi = \"10.5281/zenodo.6287342\"\n", |
81 | 72 | "\n",
|
82 | 73 | "# the url of the yaml file containing the model resource description\n",
|
83 |
| - "rdf_url = \"https://zenodo.org/record/6028056/files/rdf.yaml\"\n", |
| 74 | + "rdf_url = \"https://zenodo.org/record/6287342/files/rdf.yaml\"\n", |
84 | 75 | "\n",
|
85 | 76 | "# FIXME the model currently does not show up on the website\n",
|
86 | 77 | "# filepath to the downloaded model (either zipped package or yaml)\n",
|
|
90 | 81 | },
|
91 | 82 | {
|
92 | 83 | "cell_type": "code",
|
93 |
| - "execution_count": 7, |
| 84 | + "execution_count": null, |
94 | 85 | "id": "ce884f8c",
|
95 | 86 | "metadata": {},
|
96 |
| - "outputs": [ |
97 |
| - { |
98 |
| - "name": "stderr", |
99 |
| - "output_type": "stream", |
100 |
| - "text": [ |
101 |
| - "rdf.yaml: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.20k/3.20k [00:00<00:00, 1.28MiB/s]\n", |
102 |
| - "/home/pape/Work/bioimageio/spec-bioimage-io/bioimageio/spec/shared/schema.py:46: ValidationWarning: tags: Missing tags for categories: ['dims', 'framework', 'software']\n", |
103 |
| - " warnings.warn(msg, category=ValidationWarning)\n" |
104 |
| - ] |
105 |
| - }, |
106 |
| - { |
107 |
| - "ename": "ValidationError", |
108 |
| - "evalue": "{'_schema': ['Minimal shape [ 1. 2. 32. 32.] of output output0 is too small for halo [0, 0, 16, 16].']}", |
109 |
| - "output_type": "error", |
110 |
| - "traceback": [ |
111 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
112 |
| - "\u001b[0;31mValidationError\u001b[0m Traceback (most recent call last)", |
113 |
| - "\u001b[0;32m/tmp/ipykernel_44819/830282669.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# load model from link to rdf.yaml\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel_resource\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbioimageio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_resource_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrdf_url\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
114 |
| - "\u001b[0;32m~/Work/bioimageio/core-bioimage-io-python/bioimageio/core/resource_io/io_.py\u001b[0m in \u001b[0;36mload_resource_description\u001b[0;34m(source, weights_priority_order)\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0msource\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 41\u001b[0;31m \u001b[0mraw_rd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mload_raw_resource_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msource\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdate_to_format\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"latest\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 42\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mraw_rd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"model\"\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mweights_priority_order\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
115 |
| - "\u001b[0;32m~/Work/bioimageio/spec-bioimage-io/bioimageio/spec/io_.py\u001b[0m in \u001b[0;36mload_raw_resource_description\u001b[0;34m(source, update_to_format)\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 190\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msub_spec\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconverters\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmaybe_convert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 191\u001b[0;31m \u001b[0mraw_rd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 192\u001b[0m \u001b[0mraw_rd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 193\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", |
116 |
| - "\u001b[0;32m~/software/conda/miniconda3/envs/main39/lib/python3.9/site-packages/marshmallow/schema.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(self, data, many, partial, unknown)\u001b[0m\n\u001b[1;32m 717\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minvalid\u001b[0m \u001b[0mdata\u001b[0m \u001b[0mare\u001b[0m \u001b[0mpassed\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 718\u001b[0m \"\"\"\n\u001b[0;32m--> 719\u001b[0;31m return self._do_load(\n\u001b[0m\u001b[1;32m 720\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmany\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmany\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpartial\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpartial\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munknown\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0munknown\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostprocess\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 721\u001b[0m )\n", |
117 |
| - "\u001b[0;32m~/software/conda/miniconda3/envs/main39/lib/python3.9/site-packages/marshmallow/schema.py\u001b[0m in \u001b[0;36m_do_load\u001b[0;34m(self, data, many, partial, unknown, postprocess)\u001b[0m\n\u001b[1;32m 902\u001b[0m \u001b[0mexc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mValidationError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merrors\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalid_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 903\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandle_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmany\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmany\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpartial\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpartial\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 904\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 905\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 906\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
118 |
| - "\u001b[0;31mValidationError\u001b[0m: {'_schema': ['Minimal shape [ 1. 2. 32. 32.] of output output0 is too small for halo [0, 0, 16, 16].']}" |
119 |
| - ] |
120 |
| - } |
121 |
| - ], |
| 87 | + "outputs": [], |
122 | 88 | "source": [
|
123 | 89 | "# load model from link to rdf.yaml\n",
|
124 |
| - "# FIXME need to update the min shape, but can't right now because the model is not on the website\n", |
125 | 90 | "model_resource = bioimageio.core.load_resource_description(rdf_url)"
|
126 | 91 | ]
|
127 | 92 | },
|
128 | 93 | {
|
129 | 94 | "cell_type": "code",
|
130 |
| - "execution_count": 5, |
| 95 | + "execution_count": null, |
131 | 96 | "id": "c1230b2d",
|
132 | 97 | "metadata": {},
|
133 |
| - "outputs": [ |
134 |
| - { |
135 |
| - "name": "stderr", |
136 |
| - "output_type": "stream", |
137 |
| - "text": [ |
138 |
| - "rdf.yaml: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.92k/2.92k [00:00<00:00, 1.02MiB/s]\n" |
139 |
| - ] |
140 |
| - }, |
141 |
| - { |
142 |
| - "ename": "ValidationError", |
143 |
| - "evalue": "{'_schema': ['Minimal shape [ 1. 2. 32. 32.] of output output is too small for halo [0, 0, 16, 16].']}", |
144 |
| - "output_type": "error", |
145 |
| - "traceback": [ |
146 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
147 |
| - "\u001b[0;31mValidationError\u001b[0m Traceback (most recent call last)", |
148 |
| - "\u001b[0;32m/tmp/ipykernel_44819/725076596.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# load model from doi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel_resource\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbioimageio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_resource_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrdf_doi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
149 |
| - "\u001b[0;32m~/Work/bioimageio/core-bioimage-io-python/bioimageio/core/resource_io/io_.py\u001b[0m in \u001b[0;36mload_resource_description\u001b[0;34m(source, weights_priority_order)\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0msource\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 41\u001b[0;31m \u001b[0mraw_rd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mload_raw_resource_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msource\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdate_to_format\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"latest\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 42\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mraw_rd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"model\"\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mweights_priority_order\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
150 |
| - "\u001b[0;32m~/Work/bioimageio/spec-bioimage-io/bioimageio/spec/io_.py\u001b[0m in \u001b[0;36mload_raw_resource_description\u001b[0;34m(source, update_to_format)\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 190\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msub_spec\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconverters\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmaybe_convert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 191\u001b[0;31m \u001b[0mraw_rd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 192\u001b[0m \u001b[0mraw_rd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 193\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", |
151 |
| - "\u001b[0;32m~/software/conda/miniconda3/envs/main39/lib/python3.9/site-packages/marshmallow/schema.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(self, data, many, partial, unknown)\u001b[0m\n\u001b[1;32m 717\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minvalid\u001b[0m \u001b[0mdata\u001b[0m \u001b[0mare\u001b[0m \u001b[0mpassed\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 718\u001b[0m \"\"\"\n\u001b[0;32m--> 719\u001b[0;31m return self._do_load(\n\u001b[0m\u001b[1;32m 720\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmany\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmany\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpartial\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpartial\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munknown\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0munknown\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostprocess\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 721\u001b[0m )\n", |
152 |
| - "\u001b[0;32m~/software/conda/miniconda3/envs/main39/lib/python3.9/site-packages/marshmallow/schema.py\u001b[0m in \u001b[0;36m_do_load\u001b[0;34m(self, data, many, partial, unknown, postprocess)\u001b[0m\n\u001b[1;32m 902\u001b[0m \u001b[0mexc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mValidationError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merrors\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalid_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 903\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandle_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmany\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmany\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpartial\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpartial\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 904\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 905\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 906\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
153 |
| - "\u001b[0;31mValidationError\u001b[0m: {'_schema': ['Minimal shape [ 1. 2. 32. 32.] of output output is too small for halo [0, 0, 16, 16].']}" |
154 |
| - ] |
155 |
| - } |
156 |
| - ], |
| 98 | + "outputs": [], |
157 | 99 | "source": [
|
158 | 100 | "# load model from doi\n",
|
159 | 101 | "model_resource = bioimageio.core.load_resource_description(rdf_doi)"
|
|
451 | 393 | "\n",
|
452 | 394 | "# we use the `parent` field to indicate that the new model is created based on\n",
|
453 | 395 | "# the nucleus segmentation model we have obtained from bioimage.io\n",
|
454 |
| - "# this field is optional and only needs to be given for models that are created based on\n", |
455 |
| - "# other models from bioimage.io\n", |
| 396 | + "# this field is optional and only needs to be given for models that are created based on other models from bioimage.io\n", |
456 | 397 | "# the parent is specified via it's doi and the hash of its rdf file\n",
|
457 |
| - "rdf_file = os.path.join(model_resource.root_path, \"rdf.yaml\")\n", |
| 398 | + "model_root_folder = os.path.split(model_resource.weights[\"pytorch_state_dict\"].source)[0]\n", |
| 399 | + "rdf_file = os.path.join(model_root_folder, \"rdf.yaml\")\n", |
458 | 400 | "with open(rdf_file, \"rb\") as f:\n",
|
459 |
| - " weight_hash = hashlib.sha256(f.read()).hexdigest()\n", |
460 |
| - "parent = (rdf_doi, weight_hash)\n", |
| 401 | + " rdf_hash = hashlib.sha256(f.read()).hexdigest()\n", |
| 402 | + "parent = {\"uri\": rdf_doi, \"sha256\": rdf_hash}\n", |
461 | 403 | "\n",
|
462 | 404 | "# the name of the new model and where to save the zipped model package\n",
|
463 | 405 | "name = \"new-model1\"\n",
|
|
0 commit comments