Closed AlexandreBrown closed 6 months ago
@AlexandreBrown , indeed you are creating the experiment when you execute Experiment()
.
You can use the ExistingExperiment()
or the APIExperiment()
class interfaces. See https://www.comet.com/docs/v2/api-and-sdk/python-sdk/experiment-overview/
from comet_ml import ExistingExperiment
experiment = ExistingExperiment(previous_experiment=KEY)
experiment.get_artifact(...)
Another way: https://www.comet.com/docs/v2/api-and-sdk/python-sdk/reference/API/#apiget_artifact_files
from comet_ml import API
api = API()
api.get_artifact_files("demo", artifact_name="demo-artifact", version="2.0.0")
Describe the Bug
When instantiating an
Experiment
class to download an artifact, the experiment gets created on cometml.com even tho I did not log anything.Expected behavior
A dummy experiment should not be created every time we donwload an artifact.
No experiment should be created, we should be able to just download the artifact we want.
Where is the issue?
To Reproduce
Steps to reproduce the behavior:
Comet Debug Log
comet.log
Screenshots or GIFs
Link to Comet Project/Experiment
Additional context
Using
comet-ml
version3.38.1
Workaround
def download_artifact(api_key: str, project_name: str, workspace: str, artifact_name: str, output_dir: Path) -> Path: experiment = Experiment(api_key=api_key, project_name=project_name, workspace=workspace) artifact = experiment.get_artifact(artifact_name) artifact_path = Path(artifact.assets[0].logical_path) artifact.download(output_dir)