abhinavs95 commented on a change in pull request #14442: [MXNet-1349][Fit 
API]Add validation support and unit tests for fit() API
URL: https://github.com/apache/incubator-mxnet/pull/14442#discussion_r267091016
 
 

 ##########
 File path: python/mxnet/gluon/estimator/estimator.py
 ##########
 @@ -64,17 +65,21 @@ def __init__(self, net,
             self.loss = [loss]
         else:
             self.loss = loss or []
+            if not self.loss:
+                raise ValueError("No loss specified, refer to gluon.loss.Loss")
             for l in self.loss:
-                if not isinstance(loss, gluon.loss.Loss):
+                if not isinstance(l, gluon.loss.Loss):
                     raise ValueError("loss must be a Loss or a list of Loss, 
refer to gluon.loss.Loss")
 
         if isinstance(metrics, EvalMetric):
 
 Review comment:
   Done!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to