Hi,
I just started using wandb tools. According to the instruction here, it suggests using Artifact for new code to save models. And I am able to save the model in the offline mode. However, I wonder how to restore the model from an artifact with a particular version (e.g., v3, not necessarily the latest version of the artifact) if I want to resume the training after it’s interrupted?
I am running code on compute nodes that do not have access to internet, so I have to use the offline mode. And in offline mode, I cannot run use_artifact
command as it only works in online mode. However, I think all the artifact data is already saved locally using log_artifact
command. So in theory, I should be able to restore a particular version of the artifact? How can I get that? Even though I know the model file location, it is the latest model file, not a particular history version of the model file (that’s the point of using Artifact to track the model?).
run = wandb.init(mode='offline', project='test')
artifact = run.use_artifact('hello-world:v3')
artifact_dir = artifact.download(root=run.dir)