# How to save/restore model using artifact on servers that do not have internet access?

**URL:** <https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313>\
**Category:** W&B Help\
**Tags:** artifacts\
**Created:** [November 16, 2021, 5:24am UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313 "2021-11-16T05:24:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![taochen](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@taochen](https://community.wandb.ai/u/taochen)\
**Post date:** [November 16, 2021, 5:24am UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313/1 "2021-11-16T05:24:40Z")

</div>

Hi,

I just started using wandb tools. According to the instruction [here](https://docs.wandb.ai/ref/python/save), 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?).

```auto
    run = wandb.init(mode='offline', project='test')
    artifact = run.use_artifact('hello-world:v3')
    artifact_dir = artifact.download(root=run.dir)

```

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [November 23, 2021, 4:12pm UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313/2 "2021-11-23T16:12:26Z")

</div>

Hey Tao,

checking on this for you.

Best,  
Arman

---

<div class="post-metadata">

**Author:** ![taochen](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@taochen](https://community.wandb.ai/u/taochen)\
**Post date:** [November 30, 2021, 1:56pm UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313/3 "2021-11-30T13:56:39Z")

</div>

@armanharutyunyan Hi Arman, did you find a solution by any chance? Thanks.

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [December 2, 2021, 10:59am UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313/4 "2021-12-02T10:59:40Z")

</div>

Hey Tao, sorry about the delay on this. The offline run will be logged within your `wandb` folder that gets generated. You can access the run given the `run_id` by constructing the path and accessing the `files` within the directory. Other than that there is no way to access offline runs

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [January 31, 2022, 11:00am UTC](https://community.wandb.ai/t/how-to-save-restore-model-using-artifact-on-servers-that-do-not-have-internet-access/1313/5 "2022-01-31T11:00:13Z")

</div>

Closed on January 31, 2022, 11:00am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
