提交 97398d9f 编写于 作者: H HydrogenSulfate

fix export pretrained_model when it is None

上级 20725dd7
......@@ -548,12 +548,15 @@ class Engine(object):
"use_multilabel",
False) or "ATTRMetric" in self.config["Metric"]["Eval"][0]
model = ExportModel(self.config["Arch"], self.model, use_multilabel)
if self.config["Global"]["pretrained_model"].startswith("http"):
load_dygraph_pretrain_from_url(
model.base_model, self.config["Global"]["pretrained_model"])
else:
load_dygraph_pretrain(model.base_model,
self.config["Global"]["pretrained_model"])
if self.config["Global"]["pretrained_model"] is not None:
if self.config["Global"]["pretrained_model"].startswith("http"):
load_dygraph_pretrain_from_url(
model.base_model,
self.config["Global"]["pretrained_model"])
else:
load_dygraph_pretrain(
model.base_model,
self.config["Global"]["pretrained_model"])
model.eval()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册