# Also log experiment folder in mlflow

**URL:** <https://discuss.ray.io/t/also-log-experiment-folder-in-mlflow/5385>\
**Category:** Ray Tune\
**Created:** [March 12, 2022, 4:50pm UTC](https://discuss.ray.io/t/also-log-experiment-folder-in-mlflow/5385 "2022-03-12T16:50:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin\_Pasumarthy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nitin_pasumarthy/32/277_2.png) [@Nitin\_Pasumarthy](https://discuss.ray.io/u/Nitin_Pasumarthy)\
**Post date:** [March 12, 2022, 4:50pm UTC](https://discuss.ray.io/t/also-log-experiment-folder-in-mlflow/5385/1 "2022-03-12T16:50:34Z")

</div>

Tune does an excellent job of logging config and metrics to mlflow. After several experiments, it is not easy to connect which folder in `local_dir` corresponds to which trial in mlflow. In mlflow, it logs the trial\_name tag which are of the form `MyTrainer_3d319_00002`, `MyTrainer_3d319_00001`, etc. In `local_dir` folders are named differently, for example, `MyTrainer_2022-03-12_08-04-27`, `MyTrainer_2022-03-12_08-27-22`. This get even more challenging when we use the same experiment name and local\_dir for multiple hyperparameter explorations as each exploration leads to multiple line items in mlflow.

So I was thinking to manually log the local directory where all trials are saved as a tag to mlflow. How can I achieve this in `Trainable.setup` function? Or is there a better way to solve my problem?

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

---

<div class="post-metadata">

**Author:** ![matthewdeng](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/matthewdeng/32/1446_2.png) [@matthewdeng](https://discuss.ray.io/u/matthewdeng)\
**Post date:** [March 14, 2022, 4:12pm UTC](https://discuss.ray.io/t/also-log-experiment-folder-in-mlflow/5385/2 "2022-03-14T16:12:52Z")

</div>

Hey @Nitin_Pasumarthy, can you provide a simple repro for this?

---

<div class="post-metadata">

**Author:** ![Nitin\_Pasumarthy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nitin_pasumarthy/32/277_2.png) [@Nitin\_Pasumarthy](https://discuss.ray.io/u/Nitin_Pasumarthy)\
**Post date:** [March 16, 2022, 10:45pm UTC](https://discuss.ray.io/t/also-log-experiment-folder-in-mlflow/5385/3 "2022-03-16T22:45:25Z")

</div>

```python
exp_name = "MyFirstExp"

tune.run(
    MyTrainer,
    resources_per_trial={"gpu": NUM_GPUS_PER_POD, "cpu": NUM_CPUS_PER_POD},
    num_samples=12,
    local_dir="./ray_results",
    config={
        ... # some config
    },
    callbacks=[
        MLflowLoggerCallback(
            tracking_uri="...",
            experiment_name=exp_name,
            save_artifact=True
        )
    ]
)

```

The exp folder that gets created under `./ray_results` is different from the tag that is auto added to mlflow. This makes it challenging to map which local folder corresponds to which run on mlflow
