android-demo-app
android-demo-app copied to clipboard
ImageSegmentation model error
Hi,
I am trying to implement Instance Segmentation example on the android. At the time I first applied it, I met the error saying model verison.
So I used the code below to change the model version.
from torch.jit.mobile import (
_backport_for_mobile,
_get_model_bytecode_version,
)
MODEL_INPUT_FILE = "model_v7.ptl"
MODEL_OUTPUT_FILE = "model_v5.ptl"
print("model version", _get_model_bytecode_version(f_input=MODEL_INPUT_FILE))
_backport_for_mobile(f_input=MODEL_INPUT_FILE, f_output=MODEL_OUTPUT_FILE, to_version=5)
print("new model version", _get_model_bytecode_version(MODEL_OUTPUT_FILE))
After then, I could see two issues.
- converted model size has been doubled to ~168M --> ~336M
- when I tried to run, error message was shown
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.demo.imagesegmentation/org.pytorch.imagesegmentation.MainActivity}: com.facebook.jni.CppException: isTuple()INTERNAL ASSERT FAILED at "../aten/src/ATen/core/ivalue_inl.h":1396, please report a bug to PyTorch. Expected Tuple but got String ()
Exception raised from toTuple at ../aten/src/ATen/core/ivalue_inl.h:1396 (most recent call first):
Is there something that I missed?
Thanks,