How to get source file from dataset


i was trying to figure a way out to obtain the scource file from a Dataset. My idea was that the file might be saved in the metadata of the Dataset but it seems like the metadata is always null.

        File trainData = new File("D:\\Deeplearning4J\\face\\pics");
        FileSplit trainSplit = new FileSplit(trainData, NativeImageLoader.ALLOWED_FORMATS, randNumGen);
        PathMultiLabelGenerator labelMaker = new FaceLabelGen();
        ImageRecordReader trainRR = new ImageRecordReader(height, width, channels, labelMaker);
        DataSetIterator trainIter = new RecordReaderDataSetIterator.Builder(trainRR, batchSize)

        List<Serializable> metaDataList =;

You have run into a bug here. I’ve created an issue to keep track of it:

As a workaround you can set the flag after building the iterator:

RecordReaderDataSetIterator trainIter = new RecordReaderDataSetIterator.Builder(trainRR, batchSize)