提交 b86ddf47 编写于 作者: G gaotingquan 提交者: Tingquan Gao

fix: when eval only, AMP can be enabled

上级 0218742b
...@@ -98,8 +98,8 @@ class Engine(object): ...@@ -98,8 +98,8 @@ class Engine(object):
logger.info('train with paddle {} and device {}'.format( logger.info('train with paddle {} and device {}'.format(
paddle.__version__, self.device)) paddle.__version__, self.device))
# AMP training # AMP training and evaluating
self.amp = True if "AMP" in self.config and self.mode == "train" else False self.amp = "AMP" in self.config
if self.amp and self.config["AMP"] is not None: if self.amp and self.config["AMP"] is not None:
self.scale_loss = self.config["AMP"].get("scale_loss", 1.0) self.scale_loss = self.config["AMP"].get("scale_loss", 1.0)
self.use_dynamic_loss_scaling = self.config["AMP"].get( self.use_dynamic_loss_scaling = self.config["AMP"].get(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册