seekFire edited a comment on issue #19499:
URL: 
https://github.com/apache/incubator-mxnet/issues/19499#issuecomment-725878826


   @leezu 
   I think I may find out the error reason: when I use the class 
**mx.metric.CustomMetric** to wrap my custom metric function, the type of input 
tensor (label & pred) of this function has converted from 
**mxnet.ndarray.ndarray.NDArray** to **numpy.ndarray** automatically, so it 
will generate this error. The validation process is as follows, same script as 
above except using **numpy** to replace **mxnet.ndarray**:
   
   ```
   >>> import numpy as np
   >>> x = np.ones((2, 3, 4, 5))
   >>> y = x.transpose((0, 3, 1, 2)).reshape(0, -3, -1)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   ValueError: can only specify one unknown dimension
   ```
   The error is same as the mentioned above. I think the class 
**mx.metric.CustomMetric** of new version(e.g: 1.7.0) is different from that of 
older version, because I used to use this class to warp the same custom metric 
function and it runs OK.
   


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to