提交 fdbd4cd4 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5501 Fix: Tensor(0) is surprisingly to be falsy, which leads to loss not be recorded

Merge pull request !5501 from LiHongzhang/loss_tensor
......@@ -602,7 +602,7 @@ class SummaryCollector(Callback):
return
train_lineage = {}
loss = self._get_loss(cb_params)
if loss:
if loss is not None:
loss_numpy = loss.asnumpy()
loss = float(np.atleast_1d(loss_numpy)[0])
train_lineage[LineageMetadata.loss] = loss
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册