def predict(self):
    print('---->predicting ', self.conf.test_step)
    if (self.conf.test_step > 0):
        self.reload(self.conf.test_step)
    else:
        print('please set a reasonable test_step')
        return
    if (self.conf.data_type == '2D'):
        test_reader = H5DataLoader((self.conf.data_dir + self.conf.test_data), False)
    else:
        test_reader = H53DDataLoader((self.conf.data_dir + self.conf.test_data), self.input_shape)
    predictions = []
    while True:
        (inputs, labels) = test_reader.next_batch(self.conf.batch)
        if (inputs.shape[0] < self.conf.batch):
            break
        feed_dict = {self.inputs: inputs, self.labels: labels}
        predictions.append(self.sess.run(self.decoded_preds, feed_dict=feed_dict))
    print('----->saving predictions')
    for (index, prediction) in enumerate(predictions):
        for i in range(prediction.shape[0]):
            imsave(prediction[i], ((self.conf.sampledir + str(((index * prediction.shape[0]) + i))) + '.png'))
def predict(self):
    print('---->predicting ', self.conf.test_step)
    if (self.conf.test_step > 0):
        self.reload(self.conf.test_step)
    else:
        print('please set a reasonable test_step')
        return
    if (self.conf.data_type == '2D'):
        test_reader = H5DataLoader((self.conf.data_dir + self.conf.test_data), False)
    else:
        test_reader = H53DDataLoader((self.conf.data_dir + self.conf.test_data), self.input_shape)
    predictions = []
    while True:
        (inputs, labels) = test_reader.next_batch(self.conf.batch)
        if (inputs.shape[0] < self.conf.batch):
            break
        feed_dict = {self.inputs: inputs, self.labels: labels}
        predictions.append(self.sess.run(self.decoded_preds, feed_dict=feed_dict))
    print('----->saving predictions')
    for (index, prediction) in enumerate(predictions):
        for i in range(prediction.shape[0]):
            imsave(prediction[i], ((self.conf.sampledir + str(((index * prediction.shape[0]) + i))) + '.png'))