未验证 提交 cc096ef0 编写于 作者: T TeslaZhao 提交者: GitHub

Merge pull request #1418 from ShiningZhang/dev-bug

fix: yaml.load with argu Loader=yaml.FullLoader to adapt to pyyamlv6.0
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -33,7 +33,7 @@ def cv2_to_base64(image):
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -46,7 +46,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 30}
if device == "gpu":
......
......@@ -33,7 +33,7 @@ def cv2_to_base64(image):
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -46,7 +46,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 30}
if device == "gpu":
......
......@@ -33,7 +33,7 @@ def cv2_to_base64(image):
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -46,7 +46,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device, gpu_id):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 30}
if device == "gpu":
......
......@@ -54,7 +54,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -67,7 +67,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -28,7 +28,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def parse_benchmark(filein, fileout):
with open(filein, "r") as fin:
res = yaml.load(fin)
res = yaml.load(fin, yaml.FullLoader)
del_list = []
for key in res["DAG"].keys():
if "call" in key:
......@@ -41,7 +41,7 @@ def parse_benchmark(filein, fileout):
def gen_yml(device):
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 10}
if device == "gpu":
......
......@@ -27,7 +27,7 @@ from paddle_serving_client.utils import benchmark_args, show_latency
def gen_yml():
fin = open("config.yml", "r")
config = yaml.load(fin)
config = yaml.load(fin, yaml.FullLoader)
fin.close()
config["dag"]["tracer"] = {"interval_s": 5}
with open("config2.yml", "w") as fout:
......
......@@ -96,7 +96,7 @@ if __name__ == "__main__":
args = parse_args()
benchmark_cfg_filename = args.benchmark_cfg
f = open(benchmark_cfg_filename, 'r')
benchmark_config = yaml.load(f)
benchmark_config = yaml.load(f, yaml.FullLoader)
f.close()
benchmark_log_filename = args.benchmark_log
f = open(benchmark_log_filename, 'r')
......
......@@ -274,7 +274,7 @@ class OpAnalyst(object):
"""
import yaml
with open(op_config_yaml) as f:
op_config = yaml.load(f)
op_config = yaml.load(f, yaml.FullLoader)
# check that each model is deployed on a different card
card_set = set()
......
......@@ -341,7 +341,7 @@ class ServerYamlConfChecker(object):
" or yml_dict can be selected as the parameter.")
if yml_file is not None:
with io.open(yml_file, encoding='utf-8') as f:
conf = yaml.load(f.read())
conf = yaml.load(f.read(), yaml.FullLoader)
elif yml_dict is not None:
conf = yml_dict
else:
......
......@@ -7,7 +7,7 @@ protobuf>=3.12.2
grpcio-tools>=1.28.1
grpcio>=1.28.1
func-timeout>=4.3.5
pyyaml>=1.3.0, <6.0
pyyaml>=5.1
flask>=1.1.2
click==7.1.2
itsdangerous==1.1.0
......
......@@ -6,7 +6,7 @@ google>=2.0.3
opencv-python==4.2.0.32
protobuf>=3.12.2
func-timeout>=4.3.5
pyyaml>=1.3.0, <6.0
pyyaml>=5.1
flask>=1.1.2
click==7.1.2
itsdangerous==1.1.0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册