def test(self):
    print('---->testing ', 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)
    self.sess.run(tf.local_variables_initializer())
    count = 0
    losses = []
    accuracies = []
    m_ious = []
    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}
        (loss, accuracy, m_iou, _) = self.sess.run([self.loss_op, self.accuracy_op, self.m_iou, self.miou_op], feed_dict=feed_dict)
        print('values----->', loss, accuracy, m_iou)
        count += 1
        losses.append(loss)
        accuracies.append(accuracy)
        m_ious.append(m_iou)
    print('Loss: ', np.mean(losses))
    print('Accuracy: ', np.mean(accuracies))
    print('M_iou: ', m_ious[(- 1)])
def test(self):
    print('---->testing ', 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)
    self.sess.run(tf.local_variables_initializer())
    count = 0
    losses = []
    accuracies = []
    m_ious = []
    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}
        (loss, accuracy, m_iou, _) = self.sess.run([self.loss_op, self.accuracy_op, self.m_iou, self.miou_op], feed_dict=feed_dict)
        print('values----->', loss, accuracy, m_iou)
        count += 1
        losses.append(loss)
        accuracies.append(accuracy)
        m_ious.append(m_iou)
    print('Loss: ', np.mean(losses))
    print('Accuracy: ', np.mean(accuracies))
    print('M_iou: ', m_ious[(- 1)])