2017-12-15 1 views
0

기계 학습 알고리즘을 프로파일 링하기 위해 tfprof를 사용했습니다. 다음은 샘플 출력입니다. ================== 모델 분석 보고서 ==================== 노드 이름 | (-/3163.86b 플롭) InceptionResnetV2/InceptionResnetV2/Mixed_6a/Branch_1/Conv2d_0b_3x3/컨볼 루션 (173.41b/173.41b 퍼) InceptionResnetV2/InceptionResnetV2/Conv2d_4a_3x3/컨볼 루션 (167.25b/167.25b 퍼)tensorflow의 tfprof가 이론적 인 FLOPS를 출력합니까?

# 1 _TFProfRoot을 float_ops

여기서 '167.25b/167.25b flops'에서 두 번째 167.25b는 무엇을 나타 냅니까? 이론적 인 것이냐?

답변

0

예, 이론적 인 문제입니다. Ops는 RegisterStatistics 주석을 사용하여 통계를 등록 할 수 있습니다.

@ops.RegisterStatistics("MatMul", "flops") 
def _calc_mat_mul_flops(graph, node): 
    """Calculates the compute resources needed for MatMul.""" 
    transpose_a = node.attr["transpose_a"].b 
    a_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0]) 
    a_shape.assert_is_fully_defined() 
    if transpose_a: 
    k = int(a_shape[0]) 
    else: 
    k = int(a_shape[1]) 
    output_shape = graph_util.tensor_shape_from_node_def_name(graph, node.name) 
    output_shape.assert_is_fully_defined() 
    output_count = np.prod(output_shape.as_list()) 
    return ops.OpStats("flops", (k * output_count * 2)) 
:

Here

한 그러한 등록의 예
관련 문제