Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

ImageSegmentation model error #316

Open
mhyeonsoo opened this issue Apr 26, 2023 · 0 comments
Open

ImageSegmentation model error #316

mhyeonsoo opened this issue Apr 26, 2023 · 0 comments

Comments

@mhyeonsoo
Copy link

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.

  1. converted model size has been doubled to ~168M --> ~336M
  2. 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,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant