Open
Description
I am trying to load a model from the model zoo.
Steps:
Approach 1
pip install bioimageio.core>=0.7
- I went to download this model
- I downloaded the rdf as
nuclei.yaml
- I ran this code snippet:
from bioimageio.core import load_description_and_test
from bioimageio.spec import InvalidDescr
model_id = "nuclei.yaml"
model_description = load_description_and_test(model_id)
if isinstance(model_description, InvalidDescr):
raise Exception("Invalid model description")
- I got this error:
Traceback (most recent call last):
File "/Users/pattonw/Work/Packages/dacapo/scratch/scratch3.py", line 10, in <module>
model_description = load_description_and_test(model_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/bioimageio/core/_resource_tests.py", line 174, in load_description_and_test
rd = load_description(source, format_version=format_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/bioimageio/spec/_io.py", line 58, in load_description
opened = open_bioimageio_yaml(source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/bioimageio/spec/_internal/io_utils.py", line 107, in open_bioimageio_yaml
downloaded = download(source, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/bioimageio/spec/_internal/io.py", line 675, in resolve
strict_source = interprete_file_source(source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/bioimageio/spec/_internal/io.py", line 555, in interprete_file_source
strict = _file_source_adapter.validate_python(file_source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pattonw/Work/Packages/dacapo/.venv/lib/python3.11/site-packages/pydantic/type_adapter.py", line 412, in validate_python
return self.validator.validate_python(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 3 validation errors for union[function-after[HttpUrl(), str],RelativeFilePath,function-after[validate_file(), lax-or-strict[lax=union[json-or-python[json=function-after[path_validator(), str],python=is-instance[Path]],function-after[path_validator(), str]],strict=json-or-python[json=function-after[path_validator(), str],python=is-instance[Path]]]]]
function-after[HttpUrl(), str]
Input should be a valid URL, input is empty [type=url_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/url_parsing
RelativeFilePath
Value error, . is not a valid file path. [type=value_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/value_error
function-after[validate_file(), lax-or-strict[lax=union[json-or-python[json=function-after[path_validator(), str],python=is-instance[Path]],function-after[path_validator(), str]],strict=json-or-python[json=function-after[path_validator(), str],python=is-instance[Path]]]]
Path does not point to a file [type=path_not_file, input_value='', input_type=str]
- I reinstalled via
pip install git+https://github.com/bioimage-io/core-bioimage-io-python
, tried again and gotException: Invalid model Description
Downloading the zip and using the model name "affable-shark" both seem to work and provide valid descriptions.
Is this a bug in bioimageio.core
, a bug in the downloaded rdf
, or a user error?
Metadata
Metadata
Assignees
Labels
No labels