import tensorflow as tf


        sc = getOrCreateSparkContext()
        train_rdd = callBigDlFunc("float", "createRDDFromTFRecords",
                                  file_path, sc, serialized_graph,
                                  serialized_example.name, output_names)
        validation_rdd = None
        if validation_file_path is not None:
            validation_rdd = callBigDlFunc("float", "createRDDFromTFRecords",
                                           validation_file_path, sc, serialized_graph,
                                           serialized_example.name, output_names)

        tensor_structure = nest.pack_sequence_as(results,
                                                 [TensorMeta(tf.as_dtype(t.dtype),
                                                  shape=t.shape,
                                                  name="data_%s" % i)
                                                  for i, t in enumerate(nest.flatten(results))])

        super(TFRecordDataset, self).__init__(tensor_structure, batch_size,
                                              batch_per_thread, hard_code_batch_size)

        self.train_rdd = train_rdd
        self.validation_rdd = validation_rdd

    def get_prediction_data(self):
