Hey folks, trying to use the Model class from the clearml SDK and seeing some weird errors. I am loading a model this way and trying to see a metadata value for the Model object.
from clearml import Model
input_model = Model.query_models(project_name="Test-Projects/My_Use_Case",
model_name="CV_Task_Best",
tags=["Pipeline", "ModelVal:Passed"],
only_published=True)
path_to_best_weights = input_model[0].get_local_copy()
input_model[0].get_metadata("version")
` AttributeError Traceback (most recent call last)
Cell In [8], line 1
----> 1 input_model[0].get_metadata("version")
File /usr/local/lib/python3.8/dist-packages/clearml/model.py:491, in BaseModel.get_metadata(self, key)
481 def get_metadata(self, key):
482 # type: (str) -> Optional[str]
483 """
484 Get one metadata entry value (as a string) based on its key. See Model.get_metadata_casted
485 if you wish to cast the value to its type (if possible)
(...)
489 :return: String representation of the value of the metadata entry or None if the entry was not found
490 """
--> 491 self._reload_if_required()
492 return self.get_all_metadata().get(str(key), {}).get("value")
File /usr/local/lib/python3.8/dist-packages/clearml/model.py:557, in BaseModel._reload_if_required(self)
556 def _reload_if_required(self):
--> 557 if not self._reload_required:
558 return
559 self._get_base_model().reload()
AttributeError: 'Model' object has no attribute '_reload_required' `