Model Loading issue in android

username: mohit7
cooked: <p>My model contains nn.Functional.interpolate layer and it is converted properly to .pt model using jit.<br>
But Loading same model in android giving issues.<br>
This is happening in case of interpolate layer only.</p>
<p>Edit - Error trace</p>
<p>java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.custom_model/org.pytorch.custom_model.MainActivity}: com.facebook.jni.CppException: false CHECK FAILED at …/c10/core/Backend.h (tensorTypeIdToBackend at …/c10/core/Backend.h:106)<br>
(no backtrace available)</p>

username: zetyquickly
cooked: <p>Provide a stacktrace please</p>

username: mohit7
cooked: <p>Hey <a class="mention" href="/u/zetyquickly">@zetyquickly</a> I have edit the trace in the post. Kindly look into it</p>

username: tom
cooked: <p>The most common reason for this is version discrepancies between the PyTorch version you trace the model with and the PyTorch Mobile one.</p>
<p>Best regards</p>
<p>Thomas</p>

username: mohit7
cooked: <p>Hi <a class="mention" href="/u/tom">@tom</a> , I am using pytorch_android 1.3.1 and pytorch android torchvision 1.3.1<br>
and pytorch version 1.3.1 cpu. I didn’t find any discrepancies for versions.<br>
Can you enlighten more?</p>
<p>Thanks<br>
Mohit Ranawat</p>

username: Janice_w
cooked: <p>Hi@mohit7,I meet the same problem as you. Now I am trying to retrain the model with pytorch 1.3.If you have solved the problem, I hope you can give me some advice, thank you. You can contact with me. My email address is 1209648713@qq. com.</p>

username: mohit7
cooked: <p>Hi <a class="mention" href="/u/janice_w">@Janice_w</a> I didn’t got any solution yet. Hope I’ll get the solution.<br>
If you got the solution tell me</p>

username: kunstlicheSeele
cooked: <p>I meet this problem too(on iOS though). The model I use is from here but I use my own images for SRGAN.<br>
<aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/leftthomas/SRGAN/blob/master/model.py" target="_blank" rel="nofollow noopener">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/leftthomas/SRGAN/blob/master/model.py" target="_blank" rel="nofollow noopener">leftthomas/SRGAN/blob/master/model.py</a></h4>
<pre><code class="lang-py">import math
import torch
from torch import nn


class Generator(nn.Module):
    def __init__(self, scale_factor):
        upsample_block_num = int(math.log(scale_factor, 2))

        super(Generator, self).__init__()
        self.block1 = nn.Sequential(
            nn.Conv2d(3, 64, kernel_size=9, padding=4),
            nn.PReLU()
        )
        self.block2 = ResidualBlock(64)
        self.block3 = ResidualBlock(64)
        self.block4 = ResidualBlock(64)
        self.block5 = ResidualBlock(64)
        self.block6 = ResidualBlock(64)
        self.block7 = nn.Sequential(
</code></pre>

  This file has been truncated. <a href="https://github.com/leftthomas/SRGAN/blob/master/model.py" target="_blank" rel="nofollow noopener">show original</a>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
P.S. I tried onnx-&gt;coreml and onnx-&gt;tensorflow pb -&gt; coreml and both way failed. Very frustrated as a beginner.</p>

username: mohit7
cooked: <p>hey <a class="mention" href="/u/kunstlicheseele">@kunstlicheSeele</a> onnx to tensorflow conversion is not stable.<br>
Better to not use it.You can go fro keras to tensorflow and you can transfer your weights from pytorch to keras.<br>
Hope this helps.<br>
Thanks,<br>
Mohit Ranawat</p>

username: David_Reiss
cooked: <p>For anyone who is following this thread, the issue was resolved at <a href="https://github.com/pytorch/pytorch/issues/29806" rel="nofollow noopener">https://github.com/pytorch/pytorch/issues/29806</a></p>