提交 cca446f1 编写于 作者: L Luo Tao

fix other file format

上级 29cd97e0
...@@ -122,8 +122,8 @@ class Graph(object): ...@@ -122,8 +122,8 @@ class Graph(object):
def compute_output_shapes(self): def compute_output_shapes(self):
sorted_nodes = self.topologically_sorted() sorted_nodes = self.topologically_sorted()
for node in sorted_nodes: for node in sorted_nodes:
node.output_shape = make_tensor(*NodeKind.compute_output_shape( node.output_shape = make_tensor(
node)) *NodeKind.compute_output_shape(node))
def replaced(self, new_nodes): def replaced(self, new_nodes):
return Graph(nodes=new_nodes, name=self.name, trace=self.output_trace) return Graph(nodes=new_nodes, name=self.name, trace=self.output_trace)
......
...@@ -19,6 +19,7 @@ tracking_kpis = [ ...@@ -19,6 +19,7 @@ tracking_kpis = [
train_duration_kpi, train_duration_kpi,
] ]
def parse_log(log): def parse_log(log):
''' '''
This method should be implemented by model developers. This method should be implemented by model developers.
...@@ -37,7 +38,7 @@ def parse_log(log): ...@@ -37,7 +38,7 @@ def parse_log(log):
''' '''
for line in log.split('\n'): for line in log.split('\n'):
fs = line.strip().split('\t') fs = line.strip().split('\t')
print (fs) print(fs)
if len(fs) == 3 and fs[0] == 'kpis': if len(fs) == 3 and fs[0] == 'kpis':
kpi_name = fs[1] kpi_name = fs[1]
kpi_value = float(fs[2]) kpi_value = float(fs[2])
...@@ -50,12 +51,11 @@ def log_to_ce(log): ...@@ -50,12 +51,11 @@ def log_to_ce(log):
kpi_tracker[kpi.name] = kpi kpi_tracker[kpi.name] = kpi
for (kpi_name, kpi_value) in parse_log(log): for (kpi_name, kpi_value) in parse_log(log):
print (kpi_name, kpi_value) print(kpi_name, kpi_value)
kpi_tracker[kpi_name].add_record(kpi_value) kpi_tracker[kpi_name].add_record(kpi_value)
kpi_tracker[kpi_name].persist() kpi_tracker[kpi_name].persist()
if __name__ == '__main__': if __name__ == '__main__':
log = sys.stdin.read() log = sys.stdin.read()
log_to_ce(log) log_to_ce(log)
...@@ -183,10 +183,10 @@ def run_benchmark(model, args): ...@@ -183,10 +183,10 @@ def run_benchmark(model, args):
(pass_end - pass_start))) (pass_end - pass_start)))
#Note: The following logs are special for CE monitoring. #Note: The following logs are special for CE monitoring.
#Other situations do not need to care about these logs. #Other situations do not need to care about these logs.
print ("kpis train_acc %f" % train_avg_acc) print("kpis train_acc %f" % train_avg_acc)
print ("kpis train_cost %f" % train_avg_loss) print("kpis train_cost %f" % train_avg_loss)
print ("kpis test_acc %f" % test_avg_acc) print("kpis test_acc %f" % test_avg_acc)
print ("kpis train_duration %f" % (pass_end - pass_start)) print("kpis train_duration %f" % (pass_end - pass_start))
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册