You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2022/03/10 15:16:02 UTC
[GitHub] [incubator-mxnet] mazeltovlee opened a new issue #20951: MXNet fails to infer the shape of pad
mazeltovlee opened a new issue #20951:
URL: https://github.com/apache/incubator-mxnet/issues/20951
## Description
By constructing below symbolic graph:
```
net = mx.symbol.Variable('data', shape=(0,10,10,1))
net = mx.symbol.flatten(data=net)
net = mx.sym.reshape(data=net, shape=(0, 10, 10, 1))
net = mx.sym.pad(net, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1))
```
and run `net.infer_shape_partial()`, mxnet will raise an error:
```
[/usr/local/lib/python3.7/dist-packages/mxnet/base.py](https://localhost:8080/#) in check_call(ret)
244 """
245 if ret != 0:
--> 246 raise get_last_ffi_error()
247
248
MXNetError: MXNetError: Error in operator pad45: [15:10:16] ../src/operator/./pad-inl.h:215: Current implementation only supports 4-D or 5-D input.
```
It seems to be an incorrect error since the input to pad is indeed a 4-D input.
Moreover, if I delete the `flatten` operator, the `infer_shape_partial()` can work as expected:
<img width="804" alt="image" src="https://user-images.githubusercontent.com/91937711/157691920-4c0f1dc9-4797-4f36-b9ec-35cbf56c8b3d.png">
## To Reproduce
You can directly run above code to reproduce or access this colab link:
https://colab.research.google.com/drive/1VXSTwD7O1DyGXR_Hp23lqcWapi7Xj1xN?usp=sharing
--
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.
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org