From d3b052a71a9a6c0f7287b921f865f4cfd7ee6be2 Mon Sep 17 00:00:00 2001 From: Akimoto-Cris <29163135+Akimoto-Cris@users.noreply.github.com> Date: Sun, 10 Mar 2019 18:51:52 +0800 Subject: [PATCH] change MSElLoss attribute The current value of reduction is "mean", which is not supported by pytorch (in my case pytoch 0.4.1, python version 3). When changing it to "elementwise_mean" the interpreter dosen't complain. --- pose/losses/jointsmseloss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pose/losses/jointsmseloss.py b/pose/losses/jointsmseloss.py index ade1183..0eeb9de 100644 --- a/pose/losses/jointsmseloss.py +++ b/pose/losses/jointsmseloss.py @@ -15,7 +15,7 @@ class JointsMSELoss(nn.Module): def __init__(self, use_target_weight=True): super(JointsMSELoss, self).__init__() - self.criterion = nn.MSELoss(reduction='mean') + self.criterion = nn.MSELoss(reduction='elementwise_mean') self.use_target_weight = use_target_weight def forward(self, output, target, target_weight):