question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown builtin op: torch_scatter::scatter_max

See original GitHub issue

When I tried to load TorchScript module from C++, I got the error

terminate called after throwing an instance of 'torch::jit::ErrorReport' what(): Unknown builtin op: torch_scatter::scatter_max. Could not find any similar ops to torch_scatter::scatter_max. This op may not exist or may not be currently supported in TorchScript. : File "/opt/conda/lib/python3.7/site-packages/torch_scatter/scatter.py", line 72

The model is trained using PyTorch 1.5.0 and latest pytorch geometric, and torch scatter 2.0.5, and I converted the trained model to TorchScript. I noted the document from https://pytorch-geometric.readthedocs.io/en/latest/notes/jit.html. But it did not mention how to load the custom operators such as torch_scatter::scatter_max. The serving environment is C++, and that’s a separate environment from the training environment.

How can I resolve this error for TorchScript serving using C++?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jul 15, 2020

That’s correct. This information is currently missing in the tutorial. You need to also build the torch-scatter C++ API, see here. You can find a complete example of serving a model here.

0reactions
rusty1scommented, Dec 7, 2022

Did you take a look at https://github.com/pyg-team/pytorch_geometric/tree/master/examples/cpp? Does it work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TorchScript Error Unknown builtin op - Mobile - PyTorch Forums
Hi there,. I am trying to use a torch script exported module traced on iOS device but I am getting this error:
Read more >
Torch Vision C++ interface error "Unknown builtin op: torchvision
I'm trying to run a script in jit(using script) in torchscript for FasterRCNN. I installed CUDA 10.1, compatible cudnn, LibTorch (C++) 1.7.1 and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found