未验证 提交 f65cd37a 编写于 作者: W whs 提交者: GitHub

Fix print for py2 (#662)

上级 e40ed0f4
......@@ -105,7 +105,7 @@ def eval(args):
ratios = {}
for param in params:
ratios[param] = args.pruned_ratio
print(f"ratios: {ratios}")
print("ratios: {}".format(ratios))
pruner.prune_vars(ratios, [0])
model = paddle.Model(net, inputs, labels)
......
......@@ -86,7 +86,7 @@ def export(args):
ratios = {}
for param in params:
ratios[param] = args.pruned_ratio
print(f"ratios: {ratios}")
print("ratios: {}".format(ratios))
pruner.prune_vars(ratios, [0])
param_state_dict = paddle.load(args.checkpoint + ".pdparams")
......
......@@ -171,7 +171,7 @@ def compress(args):
for param in net.parameters():
if "conv2d" in param.name:
print(f"{param.name}\t{param.shape}")
print("{}\t{}".format(param.name, param.shape))
net.train()
model = paddle.Model(net, inputs, labels)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册