Pytorch jit script error

Hi I’m trying to export my code to jit script, but come across the following error:
RuntimeError: inputs_.size() == 1 INTERNAL ASSERT FAILED at /pytorch/torch/csrc/jit/ir.h:364, please report a bug to PyTorch. (input at /pytorch/torch/csrc/jit/ir.h:364)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7f193351b813 in /job/.local/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #1: + 0x51af79 (0x7f19364baf79 in /job/.local/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #2: + 0x516db5 (0x7f19364b6db5 in /job/.local/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #3: torch::jit::PeepholeOptimizeONNX(std::shared_ptrtorch::jit::Graph&, int, bool) + 0xcb (0x7f19364baa5b in /job/.local/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #4: + 0x4cfbd5 (0x7f193646fbd5 in /job/.local/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #5: + 0x210ba4 (0x7f19361b0ba4 in /job/.local/lib/python3.7/site-packages/torch/lib/libtorch_python.so)

frame #32: __libc_start_main + 0xe7 (0x7f193a3dab97 in /lib/x86_64-linux-gnu/libc.so.6)

Is there any clue on what problem it is? Thanks

Hi,
It looks quite bad yes.
Can you share a small code sample that reproduces this issue?

https://github.com/kmkurn/pytorch-crf/blob/1b7ced20c01352ccf70b7ae7bb99a58366de8e48/torchcrf/init.py#L259

It’s pretty deal with this function, i move out this function as a non-class function and add @torch.jit.script

Hi @shy,

This looks like an issue with some precondition in ONNX export. Do you mind filing an issue on github so we can route this to the right developers?

Thanks,
James