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


   @szha 
   Well, I think this question is not important for me, as long as the model 
can be trained with at least one image per batch...BTW, when I run some script 
like below under the shell environment, it works OK:
   ```
   >>> import mxnet as mx
   >>> x = mx.nd.ones((2, 3, 4, 5))
   >>> y = x.transpose((0, 3, 1, 2)).reshape(0, -3, -1)
   >>> y.shape    # (2, 15, 4)
   ```
   But the reshape operation in my custom metric function for segmentation task 
will generate error during training:
   `labels = labels.transpose((0, 2, 3, 1)).reshape(0, -3, -1).argmax(-1)`
   
   The error message shown as below:
   `ValueError: can only specify one unknown dimension`
   
   And I don't think `reshape(0, -3, -1)` is ambiguous for a 4-dim tensor, 
furthermore in the introduction of function **mx.nd.NDArray.reshape** there has 
similar demo...
   
   When I rectify `reshape(0, -3, -1)` to `reshape(0, -3, 0)`, the error 
changes as below:
   `ValueError: cannot reshape array of size 524288 into shape (0,newaxis,0)`
   
   So what do you think about the cause?


----------------------------------------------------------------
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