Home | News | Documentation | Download

Specify absolute path for DataLoader output

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

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:

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

evaluation fails with, e.g.:

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.

I think @moneta can give some hints

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 )


Ah, yes, it looks like #4436 fixes this. It would be nice to add some documentation, 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.

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