pytorch / android-demo-app

PyTorch android examples of usage in applications
1.46k stars 604 forks source link

roi_align op missing in android torchvision 1.9.0 #192

Open arunponnusamy opened 2 years ago

arunponnusamy commented 2 years ago

I am trying to modify the TorchVideo app to run video detection model instead of video classification.

I have converted a SlowFast model to TorchScript .ptl format with the help of pytorchvideo and by modifying the model conversion script available here.

Now the issue is, it seems that roi_align( ) function is missing in pytorch_android_torchvision:1.9.0 which is required for running detection models. The runtime error message from Android Studio is shown below

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.pytorch.demo.torchvideo, PID: 23380
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.demo.torchvideo/org.pytorch.demo.torchvideo.MainActivity}: 
com.facebook.jni.CppException: Following ops cannot be found. Check fburl.com/missing_ops for the fix.
{torchvision::roi_align, } ()
    Exception raised from print_unsupported_ops_and_throw at ../torch/csrc/jit/mobile/import.cpp:206 

Any help on this is much appreciated.

namKolorfuL commented 2 years ago

Hi @arunponnusamy, it appears that SlowFast detection model uses 2 input while the conversion script provided in this repo only accept 1 input. How did you make it work?