From 8c4a8edb47dd8fcf089e07eb66f4a2cc48266de1 Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Fri, 2 Aug 2019 08:58:31 +0800 Subject: [PATCH] fix import bug --- x2paddle/core/util.py | 9 --------- x2paddle/decoder/tf_decoder.py | 9 ++++----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/x2paddle/core/util.py b/x2paddle/core/util.py index af23254..cc58748 100644 --- a/x2paddle/core/util.py +++ b/x2paddle/core/util.py @@ -23,15 +23,6 @@ def string(param): return "\'{}\'".format(param) -def color_log(log_str): - try: - from colorama import init, Fore - init(autoreset=True) - print(Fore.RED + log_str) - except: - print(log_str) - - # This func will copy to generate code file def run_net(param_dir="./"): import os diff --git a/x2paddle/decoder/tf_decoder.py b/x2paddle/decoder/tf_decoder.py index e5e9f6a..7fc1ce3 100644 --- a/x2paddle/decoder/tf_decoder.py +++ b/x2paddle/decoder/tf_decoder.py @@ -14,7 +14,6 @@ from x2paddle.core.graph import GraphNode, Graph from x2paddle.core.fluid_code import FluidCode -from x2paddle.core.util import * from tensorflow.python.framework import tensor_util from tensorflow.python.platform import gfile from tensorflow.core.framework import attr_value_pb2 @@ -217,21 +216,21 @@ class TFDecoder(object): if need_define_shape > 0: if need_define_shape == 1: - color_log( + print( "\nUnknown shape for input tensor[tensor name: \"{}\"]". format(layer.name)) else: - color_log( + print( "\nShape[now is {}] for input tensor[tensor name: \"{}\"] not support yet" .format(shape, layer.name)) - color_log( + print( "Use your keyboard type the shape of input tensor below :)") right_shape_been_input = False while not right_shape_been_input: shape = input("Shape of Input(e.g. None,224,224,3): ") if shape.count("None") > 1: - color_log("Only 1 dimension can be None, type again:)") + print("Only 1 dimension can be None, type again:)") else: right_shape_been_input = True -- GitLab