However, I’m having some trouble using this model in android (following the instructions from here PyTorch Android ), precisely in giving input and taking the output, any help would be much appreciated …
Hey @fahad, could you share what kind of issues you’re having? logs and code snippet would be helpful for us to give suggestions. CC: @Martin_Yuan@IvanKobzarev
Sure @guangy10 , Acutally I’m using the demo app (provided by PyTorch) for Image segmentation
provided here on GitHub, which is using deeplab v3, I replaced my u2net.ptl model with deeplab v3 model and its giving me errors like follows:
java.lang.IllegalStateException: Expected IValue type 13, actual type 7
at org.pytorch.IValue.preconditionType(IValue.java:314)
at org.pytorch.IValue.toDictStringKey(IValue.java:301)
at org.pytorch.imagesegmentation.MainActivity.run(MainActivity.java:124)
at java.lang.Thread.run(Thread.java:919)
The error message said that it expects DICT_STRING_KEY (type 13) but got TUPLE (type 7). That means your model returns a tuple instead of dict. You need to call toTuple() instead.
Hey @Linbin, I tried what you suggested, but there’s another error that get raised due to that and that is in the outputTensor, it becomes unable to get the values from outTensors …
I’m attaching an image I know its a little odd to attach images written code but I want to show you the error …