PyTorch arguments not valid on android
I want to use this model in my android app. But when I start the app it falls with an error. The model works fine on my PC.
To Reproduce
Steps to reproduce the behavior:

Clone repository and use instructions in readme to run the model.
Add code below to save the model

            traced_script_module = torch.jit.trace(i2d, data)
            traced_script_module.save(&quot;i2d.pt&quot;)


I used PyTorch Android DemoApp link to run the model on android.

Error:
 E/AndroidRuntime: FATAL EXCEPTION: ModuleActivity
    Process: com.hypersphere.depthvisor, PID: 4765
    com.facebook.jni.CppException: 
    Arguments for call are not valid.
    The following variants are available:
      
      aten::upsample_bilinear2d(Tensor self, int[2] output_size, bool align_corners) -&gt; (Tensor):
      Expected at most 3 arguments but found 5 positional arguments.
      
      aten::upsample_bilinear2d.out(Tensor self, int[2] output_size, bool align_corners, *, Tensor(a!) out) -&gt; (Tensor(a!)):
      Argument out not provided.
    
    The original call is:
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\nn\functional.py(3013): interpolate
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\nn\functional.py(2797): upsample
    &lt;ipython-input-1-e1d92bec6901&gt;(75): _upsample_add
    &lt;ipython-input-1-e1d92bec6901&gt;(89): forward
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\nn\modules\module.py(534): _slow_forward
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\nn\modules\module.py(548): __call__
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\jit\__init__.py(1027): trace_module
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\torch\jit\__init__.py(875): trace
    &lt;ipython-input-12-19d2ccccece4&gt;(16): &lt;module&gt;
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\interactiveshell.py(3343): run_code
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\interactiveshell.py(3263): run_ast_nodes
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\interactiveshell.py(3072): run_cell_async
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\async_helpers.py(68): _pseudo_sync_runner
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\interactiveshell.py(2895): _run_cell
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\IPython\core\interactiveshell.py(2867): run_cell
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\zmqshell.py(536): run_cell
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\ipkernel.py(300): do_execute
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\gen.py(209): wrapper
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\kernelbase.py(545): execute_request
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\gen.py(209): wrapper
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\kernelbase.py(268): dispatch_shell
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\gen.py(209): wrapper
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\kernelbase.py(365): process_one
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\gen.py(748): run
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\gen.py(787): inner
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\ioloop.py(743): _run_callback
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\ioloop.py(690): &lt;lambda&gt;
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\asyncio\events.py(88): _run
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\asyncio\base_events.py(1786): _run_once
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\asyncio\base_events.py(541): run_forever
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\tornado\platform\asyncio.py(149): start
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel\kernelapp.py(597): start
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\traitlets\config\application.py(664): launch_instance
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\site-packages\ipykernel_launcher.py(16): &lt;module&gt;
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\runpy.py(85): _run_code
    D:\ProgramData\Anaconda\envs\ml3 torch\lib\runpy.py(193): _run_module_as_main
    Serialized   File &quot;code/__torch__/___torch_mangle_907.py&quot;, line 39
        _17 = ops.prim.NumToTensor(torch.size(_16, 2))
        _18 = ops.prim.NumToTensor(torch.size(_16, 3))
2020-06-29 23:50:09.536 4765-4872/com.hypersphere.depthvisor E/AndroidRuntime:     _19 = torch.upsample_bilinear2d(_15, [int(_17), int(_18)], False, None, None)
              ~~~~~~~~~~~~~~~~~~~~~~~~~ &lt;--- HERE
        input = torch.add(_19, _16, alpha=1)
        _20 = (_6).forward(input, )
    
        at org.pytorch.NativePeer.initHybrid(Native Method)
        at org.pytorch.NativePeer.&lt;init&gt;(NativePeer.java:18)
        at org.pytorch.Module.load(Module.java:23)
        at com.hypersphere.depthvisor.MainActivity.analyzeImage(MainActivity.java:56)
        at com.hypersphere.depthvisor.MainActivity.analyzeImage(MainActivity.java:21)
        at com.hypersphere.depthvisor.AbstractCameraXActivity.lambda$setupCameraX$2$AbstractCameraXActivity(AbstractCameraXActivity.java:86)
        at com.hypersphere.depthvisor.-$$Lambda$AbstractCameraXActivity$KgCZmrRflavSsq5aSHYb53Fi-P4.analyze(Unknown Source:2)
        at androidx.camera.core.ImageAnalysisAbstractAnalyzer.analyzeImage(ImageAnalysisAbstractAnalyzer.java:57)
        at androidx.camera.core.ImageAnalysisNonBlockingAnalyzer$1.run(ImageAnalysisNonBlockingAnalyzer.java:135)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:65)

Environment
PyTorch version: 1.5.0
Is debug build: No
CUDA used to build PyTorch: Could not collect

OS:  Windows 10 Pro
GCC version: Could not collect
CMake version: Could not collect

Python version: 3.7
Is CUDA available: No
CUDA runtime version: 10.2.89
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect

Versions of relevant libraries:
[pip3] numpy==1.18.5
[pip3] torch==1.5.0
[pip3] torchvision==0.6.0
[conda] _pytorch_select           0.1                       cpu_0  
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               10.2.89              h74a9793_1  
[conda] libmklml                  2019.0.5                      0  
[conda] mkl                       2019.4                      245  
[conda] mkl-service               2.3.0            py37hb782905_0  
[conda] mkl_fft                   1.1.0            py37h45dec08_0  
[conda] mkl_random                1.1.0            py37h675688f_0  
[conda] numpy                     1.18.5           py37h6530119_0  
[conda] numpy-base                1.18.5           py37hc3f5095_0  
[conda] pytorch                   1.5.0           cpu_py37h9f948e0_0  
[conda] torchvision               0.6.0                py37_cu102    pytorch

Android Studio 4.0
Device: Samsung s8 plus
Android version: 9


My pc PyTorch version was 1.5 and in dependences were 1.4. So solution is:
implementation 'org.pytorch:pytorch_android:1.5.0'
implementation 'org.pytorch:pytorch_android_torchvision:1.5.0'

