Skip to content

[ONNX] Export interpolate from inside a jit.script #25807

@dashesy

Description

@dashesy

🐛 Bug

Interpolate with bilinear results in

RuntimeError: Unsupported prim::Constant kind: `s`. Send a bug report.

To Reproduce

Steps to reproduce the behavior:

@torch.jit.script
def image_pool(crop, new_h, new_w):
    resized = interpolate(crop, (int(new_h), int(new_w)), mode='bilinear')

or

@torch.jit.script
def image_pool(crop, new_h, new_w):
    resized = interpolate(crop, (int(new_h), int(new_w)))

Expected behavior

Export bilinear interpolation, also print the string in the error message by changing to

                    raise RuntimeError("Unsupported prim::Constant kind: `{}` in `{}`. Send a bug report.".format(n.kindOf("value"), n))

Environment

PyTorch version: 1.2.0
Is debug build: No
CUDA used to build PyTorch: 10.0.130

OS: Ubuntu 16.04.6 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
CMake version: version 3.14.0

Python version: 2.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GTX 1070
Nvidia driver version: 418.40.04
cuDNN version: /usr/local/lib/libcudnn.so.5.1.10

Versions of relevant libraries:
[pip] mictorch==0.0.1
[pip] numpy==1.16.4
[pip] torch==1.2.0
[pip] torchvision==0.4.0
[conda] Could not collect

Additional context

Additional context

%2899 : str = prim::Constant[value="bilinear"

This is inside a jit.script in case that maters

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: onnxRelated to torch.onnxtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions