I have some models saved to the Model Registry and I’m trying to access the Metadata however it’s only returning an empty dictionary. (I do have metadata saved to the models and they can be viewed from the web gui)
Code i’m using:
api = wandb.Api()
artifact = api.artifact('your-entity/wandb-registry-model/collection:latest')
metadata = artifact.metadata
print(metadata)
I’ve also tried
run = wandb.init()
latest = run.use_artifact('your-entity/wandb-registry-model/collection:latest', type='model')
print(latest.metadata)
Both give the same empty dict output:
{}
However I can access other attributes such as artifact.name or artifact.aliases but not artifact.metadata
Hi Muqtasid:
Thank you for writing in! I’m wondering how you defined some metadata when you logged the artifact? Sharing the source code for reference, the artifact’s user_defined metadata is queryble. Could you share me a code snippet of how you init the artifact and it’s metadata?
Best, W&B
We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.
this is how im initiating the run, im not adding any metadata to the init, but I’m using the ultralytics integration of wandb which is logging the metadata for each of the runs
run = wandb.init(
project="toll_booth",
name=f"experiment_{read_exp_num()}",
id = f"experiment_{read_exp_num()}",
config={
"epochs": self.no_epochs,
"batch_size": self.batch_size,
"weight_name": self.weight_name,
"data_path": self.data_path
},
job_type="training"
)
We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.
Hi Muqtasid, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!