Open pengwa opened 6 years ago
I run resnetv1-152 ONNX model with onnx-caffe2 backend, failed with below message:
ONNX FATAL: [enforce fail at backend.cc:653] . Caffe2 only supports padding 2D Tensor, whereas padding is [0, 3, 3, 0, 0, 3, 3, 0, ] ONNX FATAL: [enforce fail at backend.cc:653] . Caffe2 only supports padding 2D Tensor, whereas padding is [0, 1, 1, 0, 0, 1, 1, 0, ] ONNX FATAL: [enforce fail at backend.cc:653] . Caffe2 only supports padding 2D Tensor, whereas padding is [0, 1, 1, 0, 0, 1, 1, 0, ] ONNX FATAL: [enforce fail at backend.cc:653] . Caffe2 only supports padding 2D Tensor, whereas padding is [0, 1, 1, 0, 0, 1, 1, 0, ]
errors thrown file https://github.com/pytorch/pytorch/blob/master/caffe2/onnx/backend.cc, seems the conversion for Pad is limited in current implementation.
The ONNX operator for Pad is:
node { input: "input:0" output: "resnet_v1_152/Pad:0" name: "resnet_v1_152/Pad" op_type: "Pad" attribute { name: "pads" ints: 0 ints: 3 ints: 3 ints: 0 ints: 0 ints: 3 ints: 3 ints: 0 type: INTS } }
Please copy and paste the output from our environment collection script (or fill out the checklist below manually).
You can get the script and run it with:
# For security purposes, please check the contents of collect_env.py before running it. python collect_env.py
cmake .. -DPYTHON_INCLUDE_DIR=/usr/include/python3.5 -DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") -DPYTHON_EXECUTABLE=/usr/bin/python3 make install
cmake .. -DPYTHON_INCLUDE_DIR=/usr/include/python3.5 -DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") -DPYTHON_EXECUTABLE=/usr/bin/python3
make install
Doesn't seem related to torch.onnx so removing module: onnx.
torch.onnx
module: onnx
Issue description
I run resnetv1-152 ONNX model with onnx-caffe2 backend, failed with below message:
errors thrown file https://github.com/pytorch/pytorch/blob/master/caffe2/onnx/backend.cc, seems the conversion for Pad is limited in current implementation.
Code example
The ONNX operator for Pad is:
System Info
Please copy and paste the output from our environment collection script (or fill out the checklist below manually).
You can get the script and run it with: