Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_description() can't load descriptions for previous working ones #663

Open
qin-yu opened this issue Nov 21, 2024 · 1 comment · May be fixed by #664
Open

load_description() can't load descriptions for previous working ones #663

qin-yu opened this issue Nov 21, 2024 · 1 comment · May be fixed by #664

Comments

@qin-yu
Copy link

qin-yu commented Nov 21, 2024

There are two runs with an hour or two in between, today: here and here.

self = <plantseg.core.zoo.ModelZoo object at 0x7fa99c6d2540>
model_id = 'efficient-chipmunk'
    def get_model_by_id(self, model_id: str):
        """Load model from BioImage.IO Model Zoo.
    
        E.g. model_id = 'efficient-chipmunk', whose RDF URL is:
        https://bioimage-io.github.io/collection-bioimage-io/rdfs/10.[52](https://github.com/kreshuklab/plant-seg/actions/runs/11962866393/job/33352160971#step:11:53)81/zenodo.8401064/8429203/rdf.yaml
        """
    
        if not self._bioimageio_zoo_all_model_url_dict:
            self.refresh_bioimageio_zoo_urls()
    
        if model_id not in self._bioimageio_zoo_all_model_url_dict:
            raise ValueError(f"Model ID {model_id} not found in BioImage.IO Model Zoo")
    
        rdf_url = self._bioimageio_zoo_all_model_url_dict[model_id]
        model_description = load_description(rdf_url)  # FIXME: HERE - I think it's an issue from Bioimage.IO Spec
    
        # Check if description is `ResourceDescr`
        if isinstance(model_description, InvalidDescr):
            model_description.validation_summary.display()
>           raise ValueError(f"Failed to load {model_id}")
E           ValueError: Failed to load efficient-chipmunk
plantseg/core/zoo.py:343: ValueError
----------------------------- Captured stdout call -----------------------------
                                                                                
  ❌                bioimageio format validation failed                         
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
  source            https://bioimage-io.github.io/collection-bioimage-io/rdfs…  
  format version    model 0.4.9                                                 
  bioimageio.spec   0.5.3.5                                                     
                                                                                
                                                                                
  ❓   location                    detail                                       
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
  ✔️    .                           initialized InvalidDescr to describe model   
                                   unknown                                      
  ❌   .                           bioimageio.spec format validation model      
                                   0.4.10                                       
  🔍   context.perform_io_checks   True                                         
  🔍   context.root                https://bioimage-io.github.io/collection-b…  
  🔍   context.warning_level       error                                        
  ❌   .                           ModelDescr is not fully defined; you should  
                                   define Path, then call                       
                                   ModelDescr.model_rebuild().For further       
                                   information visit                            
                                   https://errors.pydantic.dev/2.10/u/class-n…  
                                   common_nodes.py, line 414, in _load_impl     
                                   rd = cls.model_validate(data)                
                                   ^^^^^^^^^^^^^^^^^^^^^^^^node.py, line 66,    
                                   in model_validate    return                  
                                   super().model_validate(                      
                                   ^^^^^^^^^^^^^^^^^^^^^^^main.py, line [62](https://github.com/kreshuklab/plant-seg/actions/runs/11962866393/job/33352160971#step:11:63)2,    
                                   in model_validate    return                  
                                   cls.__pydantic_validator__.validate_python(  
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…  
                                   line 100, in getattr    raise                
                                   PydanticUserError(self._error_message,       
                                   code=self._code)
@FynnBe
Copy link
Member

FynnBe commented Nov 23, 2024

cannot reproduce this with pydantic 2.9.2, but after updating to pydantic 2.10.1.
It is likely related to pydantic/pydantic#10925
Will investigate a fix. In the meantime please pin to pydantic <2.10

@FynnBe FynnBe linked a pull request Nov 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants