Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onnx-caffe2] Caffe2 only supports padding 2D Tensor #9411

Closed
pengwa opened this issue Jul 13, 2018 · 1 comment
Closed

[onnx-caffe2] Caffe2 only supports padding 2D Tensor #9411

pengwa opened this issue Jul 13, 2018 · 1 comment
Labels

Comments

@pengwa
Copy link

pengwa commented Jul 13, 2018

Issue description

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.

Code example

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

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:


# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch or Caffe2: Caffe2(onnx-caffe2)
  • How you installed PyTorch (conda, pip, source): source
  • Build command you used (if compiling from source):

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

  • OS: Ubuntu 16.04
  • PyTorch version: master branch, commit: 290d20b
  • Python version: 3.5
  • CUDA/cuDNN version: 9.0/7.1
  • GPU models and configuration: Quadro K620, 1993MB
  • GCC version (if compiling from source): gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  • CMake version: 3.11.0
  • Versions of any other relevant libraries:
@zou3519 zou3519 added module: onnx Related to torch.onnx caffe2 labels Jul 16, 2018
@garymm
Copy link
Collaborator

garymm commented Aug 13, 2021

Doesn't seem related to torch.onnx so removing module: onnx.

@garymm garymm removed the module: onnx Related to torch.onnx label Aug 13, 2021
@drisspg drisspg closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants