# Specify absolute path for DataLoader output

**URL:** <https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541>\
**Category:** TMVA\
**Created:** [March 23, 2020, 6:36pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541 "2020-03-23T18:36:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwilkins](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mwilkins/32/28332_2.png) [@mwilkins](https://root-forum.cern.ch/u/mwilkins)\
**Post date:** [March 23, 2020, 6:36pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541/1 "2020-03-23T18:36:42Z")

</div>

One specifies the output directory for a `DataLoader` using the `thedlName` input parameter:

```python
mydl = DataLoader("output/directory")

```

This results in the creation of `output/directory/weights/`, which contains the requisite `.xml` and `.C` files generated by TMVA.

The same directory structure gets used in the output file by default. That is, there will be a `TDirectory` called “output” that contains another `TDirectory` called “directory” in the output ROOT file.

If, however, I specify the absolute path to the directory I want to create, like so:

```python
mydl = DataLoader("/abs/path/to/output/directory")

```

evaluation fails with, e.g.:

```bash
PATH: /abs/path/to/output/directory/myBDT_fold1.root
Error in <TFile::GetObjectChecked>: The provided key name is invalid.

```

presumably because ROOT does not expect an absolute path as a `TDirectory` tree structure.

Is there a way around this? I’d like to be able to steer the output of my script without mucking up the internal structure of my output training files.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 23, 2020, 9:41pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541/2 "2020-03-23T21:41:01Z")

</div>

I think @moneta can give some hints

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 24, 2020, 2:27pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541/3 "2020-03-24T14:27:22Z")

</div>

Hi,  
Which ROOT version are you using ?  
I think this issue has been fixed in 6,20, (see [https://sft.its.cern.ch/jira/browse/ROOT-8887](https://sft.its.cern.ch/jira/browse/ROOT-8887) )

Lorenzo

---

<div class="post-metadata">

**Author:** ![mwilkins](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mwilkins/32/28332_2.png) [@mwilkins](https://root-forum.cern.ch/u/mwilkins)\
**Post date:** [March 24, 2020, 4:43pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541/4 "2020-03-24T16:43:49Z")

</div>

Ah, yes, it looks like [#4436](https://github.com/root-project/root/pull/4436) fixes this. It would be nice to add some [documentation](https://root.cern.ch/doc/v612/classTMVA_1_1DataLoader.html#a6e4885a00005624465889cb9e18845a3), though; right now, there’s no explanation of `thedlName` at all.

I am using 6.18/04 (latest available to me on cvmfs). I’m working around the issue by changing the working directory inside the script.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 26, 2020, 2:14pm UTC](https://root-forum.cern.ch/t/specify-absolute-path-for-dataloader-output/38541/5 "2020-03-26T14:14:26Z")

</div>

Hi,  
Thank you for the feedback. I have updated the documentation of the DataLoader class

Lorenzo
