I am able to access the artifact via code and terminal. But when using sagemaker estimator, it isn’t able to download it. I get an error message saying that the project does not contain the artifact. I am using the full artifact name just as in the terminal.
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>
I’m using the default sagemaker estimator not a custom docker. I also am using the default wandb server.
I do see https://api.wandb.ai as the WANDB_BASE_URL environment variable when I print it out inside the script. I pass it in through the environment parameter of the estimator function (Estimators — sagemaker 2.197.0 documentation).
I’m just wondering if I could be missing something else?
Just so I can get a better idea of what’s going on, I have a few questions:
Are you able to access the artifact in question through the UI? If so, could you also run the following command to verify that the artifact is accessible:
wandb artifact get <entity>/<project>/<artifact-name>
What does your code look like in terms of using this artifact? How are you accessing this in your workflow?
If you could give us a reproducible script/pseudocode, I would love to test this out on my end to dig further. And could you also send the full error stack trace?
Adding the API key in the docker seems to resolve the issue as I am able to download the artifact.
So the secrets.env way seems to be cause of the issue. Although it is able log in and create the runs in the w&b account, its not able to download the artifact. Any idea why?
@rahulraj Glad to hear the issue is resolved. My thoughts are this: without a valid API key, access to certain artifacts may be restricted. By providing the API key in the Docker environment, you are enabling the SageMaker Estimator to authenticate and access the artifacts (which you need for .download)
I wouldn’t say the issue has been resolved, as I don’t want to put the API key in the docker file.
I follow the recommended steps of calling wandb.sagemaker_auth(), and the secrets.env file is created correctly.
wandb has no problems creating the run logs as I can see them on the dashboard, so the authentication must be happening.
When it comes to downloading the artifact, however, there is an issue.
Hey @rahulraj, this is a known issue and I’ll be sure to add your information to the bug report. I will update you as progress arises on the issue. What SDK version are you on?