(sess, ops)
ops: dict mapping from string to tf ops
ops: dict mapping from string to tf ops
ops : dict mapping from string to tf ops
def eval_one_epoch(sess, ops):
    """ ops: dict mapping from string to tf ops """
    start_time = time.time()

    is_training = False
    total_correct = 0
    total_seen = 0
    loss_sum = 0
    total_seen_class = [0 for _ in range(NUM_CLASSES)]
    total_correct_class = [0 for _ in range(NUM_CLASSES)]

    for fn in range(len(TEST_FILES)):
        log_string("----" + str(fn) + "-----")
        current_data, current_label = provider.loadDataFile(TEST_FILES[fn])
        current_data = current_data[:, 0:NUM_POINT, :]
        current_label = np.squeeze(current_label)

        file_size = current_data.shape[0]
        num_batches = file_size // BATCH_SIZE

        for batch_idx in range(num_batches):
            start_idx = batch_idx * BATCH_SIZE
            end_idx = (batch_idx + 1) * BATCH_SIZE

            feed_dict = {
                ops["pointclouds_pl"]: current_data[start_idx:end_idx, :, :],
                ops["labels_pl"]: current_label[start_idx:end_idx],
                ops["is_training_pl"]: is_training,
            }
            summary, step, loss_val, pred_val = sess.run(
                [ops["merged"], ops["step"], ops["loss"], ops["pred"]],
                feed_dict=feed_dict,
            )
            pred_val = np.argmax(pred_val, 1)
            correct = np.sum(pred_val == current_label[start_idx:end_idx])
            total_correct += correct
            total_seen += BATCH_SIZE
            loss_sum += loss_val * BATCH_SIZE
            for i in range(start_idx, end_idx):
                l = current_label[i]
                total_seen_class[l] += 1
                total_correct_class[l] += pred_val[i - start_idx] == l

    log_string("eval mean loss: %f" % (loss_sum / float(total_seen)))
    log_string("eval accuracy: %f" % (total_correct / float(total_seen)))
    log_string(
        "eval avg class acc: %f"
        % (
            np.mean(
                np.array(total_correct_class)
                / np.array(total_seen_class, dtype=np.float)
            )
        )
    )

    duration = time.time() - start_time
    log_string("eval duration (minutes): %.4f" % (duration / 60.0))
def eval_one_epoch ( sess , ops ) : start_time = time . time ( ) is_training = False total_correct = 0 total_seen = 0 loss_sum = 0 total_seen_class = [ 0 for _ in range ( NUM_CLASSES ) ] total_correct_class = [ 0 for _ in range ( NUM_CLASSES ) ] for fn in range ( len ( TEST_FILES ) ) : log_string ( "----" + str ( fn ) + "-----" ) current_data , current_label = provider . loadDataFile ( TEST_FILES [ fn ] ) current_data = current_data [ : , 0 : NUM_POINT , : ] current_label = np . squeeze ( current_label ) file_size = current_data . shape [ 0 ] num_batches = file_size // BATCH_SIZE for batch_idx in range ( num_batches ) : start_idx = batch_idx * BATCH_SIZE end_idx = ( batch_idx + 1 ) * BATCH_SIZE feed_dict = { ops [ "pointclouds_pl" ] : current_data [ start_idx : end_idx , : , : ] , ops [ "labels_pl" ] : current_label [ start_idx : end_idx ] , ops [ "is_training_pl" ] : is_training , } summary , step , loss_val , pred_val = sess . run ( [ ops [ "merged" ] , ops [ "step" ] , ops [ "loss" ] , ops [ "pred" ] ] , feed_dict = feed_dict , ) pred_val = np . argmax ( pred_val , 1 ) correct = np . sum ( pred_val == current_label [ start_idx : end_idx ] ) total_correct += correct total_seen += BATCH_SIZE loss_sum += loss_val * BATCH_SIZE for i in range ( start_idx , end_idx ) : l = current_label [ i ] total_seen_class [ l ] += 1 total_correct_class [ l ] += pred_val [ i - start_idx ] == l log_string ( "eval mean loss: %f" % ( loss_sum / float ( total_seen ) ) ) log_string ( "eval accuracy: %f" % ( total_correct / float ( total_seen ) ) ) log_string ( "eval avg class acc: %f" % ( np . mean ( np . array ( total_correct_class ) / np . array ( total_seen_class , dtype = np . float ) ) ) ) duration = time . time ( ) - start_time log_string ( "eval duration (minutes): %.4f" % ( duration / 60.0 ) )