mlhub-tutorials
mlhub-tutorials copied to clipboard
MlModel not working as expected
Hey there! Hoping someone can help me troubleshoot. I've got an api key and can successfully replicate steps to view data sets, but to see the MLmodels I keep getting an error:
from radiant_mlhub import MLModel
models = MLModel.list()
first_model = models[0]
TypeError: init() got an unexpected keyword argument 'assets'
However I can successfully do this:
models = list_models()
first_model = models[0]
and this:
from radiant_mlhub.client import get_model_by_id
model = get_model_by_id('model_ramp_baseline_v1')
model.keys()
But not this:
from radiant_mlhub import MLModel model = MLModel.fetch('model_ramp_baseline_v1')
TypeError Traceback (most recent call last) /home/lauren/Projects/notebooks/download_weights.ipynb Cell 9 in <cell line: 2>() 1 from radiant_mlhub import MLModel ----> 2 model = MLModel.fetch(ramp_model)
File ~/miniconda3/envs/deep-learning/lib/python3.9/site-packages/radiant_mlhub/models/ml_model.py:74, in MLModel.fetch(cls, model_id, api_key, profile) 57 """Fetches a :class:
MLModel
instance by id. 58 59 Parameters (...) 71 model : MLModel 72 """ 73 d = client.get_model_by_id(model_id, api_key=api_key, profile=profile) ---> 74 return cls.from_dict(d, api_key=api_key, profile=profile)File ~/miniconda3/envs/deep-learning/lib/python3.9/site-packages/radiant_mlhub/models/ml_model.py:113, in MLModel.from_dict(cls, d, href, root, migrate, preserve_dict, api_key, profile) 99 @classmethod 100 def from_dict( 101 cls, (...) 109 profile: Optional[str] = None 110 ) -> MLModel: 111 """Patches the :meth:
pystac.Item.from_dict
method so that it returns the calling 112 class instead of always returning a :class:pystac.Item
instance.""" ... 477 ) 479 has_self_link = False 480 for link in links:TypeError: init() got an unexpected keyword argument 'assets'