Tutorial provided torch model to android app failed

username: xin123
cooked: <ul>
<li>
<p>torch version 1.12.1+cu113</p>
</li>
<li>
<p>torchvision version 0.13.1+cu113</p>
</li>
<li>
<p>android studio version<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/7/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/7/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9_2_690x365.jpeg" alt="image" data-base62-sha1="zgU4K2eyp9x1FqAnPpEscA67EY9" width="690" height="365" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/7/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9_2_690x365.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/f/7/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9_2_1035x547.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/f/7/f735466a61fe644f64f7b8dd9641ebc1f9cb76d9_2_1380x730.jpeg 2x" data-dominant-color="3E4145"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1958×1036 194 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
</li>
</ul>
<p>I have been following the tutorial (<a href="https://pytorch.org/tutorials/beginner/deeplabv3_on_android.html" class="inline-onebox" rel="noopener nofollow ugc">Image Segmentation DeepLabV3 on Android — PyTorch Tutorials 2.2.0+cu121 documentation</a>) to use a torch model inside an android app, but in the “Module Load Period”, the app will crash.</p>
<p>Only one line of code in android:</p>
<blockquote>
<p>Module module = Module.load(MainActivity.assetFilePath(getApplicationContext(), “deeeplabv3_scripted.pt”));</p>
</blockquote>
<p>The crash message is</p>
<blockquote>
<p>E/libc++abi: terminating with uncaught exception of type c10::Error: isTuple()INTERNAL ASSERT FAILED at “…/…/…/…/src/main/cpp/libtorch_include/arm64-v8a/ATen/core/ivalue_inl.h”:1400, please report a bug to PyTorch. Expected Tuple but got String<br>
Exception raised from toTuple at …/…/…/…/src/main/cpp/libtorch_include/arm64-v8a/ATen/core/ivalue_inl.h:1400 (most recent call first):<br>
(no backtrace available)</p>
</blockquote>
<p>I hope anyone helps me. Thanks!</p>

username: fab_pel
cooked: <p>Hi, any idea on how to solve the issue?<br>
I’m having the same error on the Obj. Detection demo app (<a href="https://github.com/pytorch/android-demo-app/tree/master/ObjectDetection" class="inline-onebox" rel="noopener nofollow ugc">android-demo-app/ObjectDetection at master · pytorch/android-demo-app · GitHub</a>) when I train it on custom dataset with pytorch 1.12.1+cu116 and torchvision version 0.13.1+cu116.</p>
<p>May the error be due to the pytorch version?<br>
I’m not sure where to look for an hint on the origin of the problem…<br>
Thanks</p>

username: xin123
cooked: <p>I have went to use Tensorflow and it works. My app is in the google Playstore. Everything is fine:)</p>

username: Ke_Zhao
cooked: <p>Hi, this problem still exists. Could someone look into this? Thanks.</p>