I developed a Keypoint RCNN Detection model, but when deploying it on Android, I encountered this error:
Process: com.example.java_pytorch, PID: 5028
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.java_pytorch/com.example.java_pytorch.MainActivity}: com.facebook.jni.CppException:
Unknown builtin op: torchvision::nms.
Could not find any similar ops to torchvision::nms. This op may not exist or may not be currently supported in TorchScript.
:
File "code/__torch__/torchvision/models/detection/keypoint_rcnn/___torch_mangle_501.py", line 783
_360 = torch.index(boxes4, _359)
_361 = annotate(List[Optional[Tensor]], [curr_indices])
curr_keep_indices = ops.torchvision.nms(_360, torch.index(scores1, _361), 0.69999999999999996)
~~~~~~~~~~~~~~~~~~~ <--- HERE
_362 = annotate(List[Optional[Tensor]], [curr_keep_indices])
_363 = torch.index(curr_indices, _362)
I’ve already included these dependencies:
implementation ‘org.pytorch:pytorch_android:1.13.0’
implementation ‘org.pytorch:pytorch_android_torchvision:1.13.0’
implementation ‘org.pytorch:torchvision_ops:0.13.0’
implementation ‘com.facebook.soloader:nativeloader:0.8.0’
Can anyone help me understand and resolve this error?