# ERROR: Project does not contain artifact

**URL:** <https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314>\
**Category:** W&B Help\
**Created:** [October 24, 2022, 8:50pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314 "2022-10-24T20:50:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dspectrum](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dspectrum](https://community.wandb.ai/u/dspectrum)\
**Post date:** [October 24, 2022, 8:50pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/1 "2022-10-24T20:50:40Z")

</div>

I’m running the following code to initialize a run and use my dataset as an artifact:

```auto
    run = wandb.init(name=job_name, project=wandb_project_name, config=vars(args), save_code=True, job_type="training")
    wandb.run.log_code(".")
    print(wandb_dataset_name)
    dataset = run.use_artifact(wandb_dataset_name)

```

This code is in a Sagemaker script and when I run, everything works as expected. However, when I run the same exact script in a Sagemaker hyper parameter tuning job instead of a single training job, I get the following error:

> wandb: WARNING Calling wandb.login() after wandb.init() has no effect.  
> distributedspectrum/RadioML-Experimentation/RadioML\_tfrecords:v0  
> wandb: WARNING Calling wandb.login() after wandb.init() has no effect.  
> wandb: WARNING Calling wandb.login() after wandb.init() has no effect.  
> wandb: ERROR Project distributedspectrum/RadioML-Experimentation does not contain artifact: “RadioML\_tfrecords:v0”  
> Traceback (most recent call last):  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/normalize.py”, line 26, in wrapper  
> return func(\*args, \*\*kwargs)  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 937, in artifact  
> artifact = Artifact(self.client, entity, project, artifact\_name)  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 4151, in **init**  
> self.\_load()  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 4735, in \_load  
> raise ValueError(  
> ValueError: Project distributedspectrum/RadioML-Experimentation does not contain artifact: “RadioML\_tfrecords:v0”  
> During handling of the above exception, another exception occurred:  
> Traceback (most recent call last):  
> File “radioml-training.py”, line 306, in   
> main(args)  
> File “radioml-training.py”, line 175, in main  
> dataset = run.use\_artifact(wandb\_database\_name)  
> File “/usr/local/lib/python3.8/site-packages/wandb/sdk/wandb\_run.py”, line 255, in wrapper  
> return func(self, \*args, \*\*kwargs)  
> File “/usr/local/lib/python3.8/site-packages/wandb/sdk/wandb\_run.py”, line 2575, in use\_artifact  
> artifact = public\_api.artifact(type=type, name=name)  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/normalize.py”, line 62, in wrapper  
> raise CommError(message, err).with\_traceback(sys.exc\_info()[2])  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/normalize.py”, line 26, in wrapper  
> return func(\*args, \*\*kwargs)  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 937, in artifact  
> artifact = Artifact(self.client, entity, project, artifact\_name)  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 4151, in **init**  
> self.\_load()  
> File “/usr/local/lib/python3.8/site-packages/wandb/apis/public.py”, line 4735, in \_load  
> raise ValueError(  
> wandb.errors.CommError: Project distributedspectrum/RadioML-Experimentation does not contain artifact: “RadioML\_tfrecords:v0”

Literally everything is exactly the same but I suddenly get this error. I’m also not sure why the warnings about wandb.login() appear as well. They don’t appear in the single training job and I don’t ever call wandb.login() in my code.

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [October 25, 2022, 9:30pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/2 "2022-10-25T21:30:18Z")

</div>

Hi @dspectrum , happy to help with the issue you are facing.

A few things come to mind.

- Do you see this artifact in the UI?
- Are you able to **get** the artifact via the command line? `wandb artifact get <entity>/<project>/<artifact-name>`
- Have you verified your sagemaker host environmental variable is referenced correctly prior to executing the training ? `wandb status` to check **“base\_url”**. To set, use `export WANDB_BASE_URL=<HOST>:<PORT>`

---

<div class="post-metadata">

**Author:** ![dspectrum](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dspectrum](https://community.wandb.ai/u/dspectrum)\
**Post date:** [October 25, 2022, 10:07pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/3 "2022-10-25T22:07:59Z")

</div>

Yes, the artifact is in the UI! I am able to get everything to work perfectly when I run in Sagemaker with one instance. It’s just when I launch a hyperparameter tuning job that it doesn’t work.

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [November 9, 2022, 8:54pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/4 "2022-11-09T20:54:43Z")

</div>

Hi @dspectrum, following up on this. We ran some tests and were successful in utilizing artifacts within sagemaker. Are you still experiencing the same errors as before.

One thing you can try is to include the full entity/project path to the artifact name. For example, instead of

`artifact_name = “RadioML_tfrecords:v0”`  
use  
`artifact_name = “<entity>/<project-name>/RadioML_tfrecords:v0”`

it might be that in SM, the entity and project it inherits from the run is different than where the artifact is.

---

<div class="post-metadata">

**Author:** ![dspectrum](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dspectrum](https://community.wandb.ai/u/dspectrum)\
**Post date:** [November 11, 2022, 9:24pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/5 "2022-11-11T21:24:27Z")

</div>

Thanks for following up! To clarify, I have also been able to successfully use artifacts in sagemaker. It’s only when I switch from a normal training job to a hyper parameter tuning job ([HyperparameterTuner — sagemaker 2.116.0 documentation](https://sagemaker.readthedocs.io/en/stable/api/training/tuner.html)) that this error occurs.

Also apologies if this was unclear but I am actually referring to the full path in my code.

When I run `print(wandb_dataset_name)` you can see that I prints `distributedspectrum/RadioML-Experimentation/RadioML_tfrecords:v0`

Thanks for the help so far, let me know what you think!

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [November 15, 2022, 11:24pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/6 "2022-11-15T23:24:29Z")

</div>

Hi @dspectrum , thank you for the clarifying remarks. I’ll run some additional tests on our end as I was still unable to replicate. In the meantime could you try [use\_artifact](https://docs.wandb.ai/ref/python/run#use_artifact)`use_artifact("<entity>/<project>/<artifact>:latest")`

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [November 21, 2022, 7:50pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/8 "2022-11-21T19:50:14Z")

</div>

Hi @dspectrum , following up on this. Are you still experiencing issues with using artifacts with your hyperparameter training runs with sagemaker?

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [November 28, 2022, 5:22pm UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/9 "2022-11-28T17:22:42Z")

</div>

Hi @dspectrum 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!

---

<div class="post-metadata">

**Author:** ![dspectrum](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dspectrum](https://community.wandb.ai/u/dspectrum)\
**Post date:** [November 30, 2022, 3:21am UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/10 "2022-11-30T03:21:13Z")

</div>

Hi,  
Very sorry for the delay here. I tried again with :latest instead of :v0 but got the same result.

---

<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 29, 2023, 3:21am UTC](https://community.wandb.ai/t/error-project-does-not-contain-artifact/3314/11 "2023-01-29T03:21:57Z")

</div>

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