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: torchvision::nms

See original GitHub issue

build.gradle

    plugins {
        id 'java'
    }
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
        implementation group: 'ai.djl.pytorch', name: 'pytorch-engine', version: '0.10.0'
        implementation group: 'ai.djl.pytorch', name: 'pytorch-native-cpu', version: '1.7.1'
    
        implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
    }

Predict.java

    import ai.djl.MalformedModelException;
    import ai.djl.Model;
    
    import javax.imageio.ImageIO;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    
    public class Predict {
        public static void main(String[] args) {
            Path modelDir = Paths.get("src/main/resources/fasterrcnn_resnet50.pt");
    
            try (Model model = Model.newInstance("fasterrcnn_resnet50")) {
                model.load(modelDir);
            } catch (IOException | MalformedModelException e) {
                e.printStackTrace();
            }
        }
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stu1130commented, Apr 5, 2021

@anandvsr nms is TorchVision operator that we don’t support. It is still blocked by https://github.com/pytorch/vision/issues/2692.

0reactions
smeet2804commented, Oct 27, 2021

Thanks @stu1130 , I tried, but not able to run make command after cmake ... It gives make *** no targets specified and no makefile found. stop. Don’t know where I’m going wrong. I tried it on Windows 10 through anaconda prompt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown builtin op: torchvision::nms when loading scripted ...
Bug Scripted FasterRCNN saved to a .pt-file cannot be loaded via torch.script.load due to Unknown builtin op: torchvision::nms.
Read more >
Torch Vision C++ interface error "Unknown builtin op: torchvision
Any ideas or suggestion on how to cure this error: seems like the operator nms is not registered. By the way the master...
Read more >
No such operator torchvision::nms Fix - Pav Creations
Unknown builtin op : torchvision::nms. Could not find any similar ops to torchvision::nms. This op may not exist or may not be currently ......
Read more >
"Unknown Builtin Op: Torchvision::Nms" - ADocLib
Scripting a function or nn.Module will inspect the source code compile it as TorchScript code using the TorchScript compiler and return a ScriptModule...
Read more >
Torchscript frcnn model with nms in python and load in C++ ...
I'm still running into problems when loading the scripted model in libtorch complaining about nms being an “Unknown builtin op”. Here's the ...
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