How to use a ready-trained neural network?

username: MACHOCAPTCHA
cooked: <p>I found a neural network model that gets a depth map from an image in <a href="https://github.com/OniroAI/MonoDepth-PyTorch" class="inline-onebox" rel="noopener nofollow ugc">GitHub - OniroAI/MonoDepth-PyTorch: Unofficial implementation of Unsupervised Monocular Depth Estimation neural network MonoDepth in PyTorch</a>. monodepth_resnet18_001.pth. How can I use this network? How can I just test it in my Pytorch?</p>

username: ptrblck
cooked: <p>You could read through the linked repository and see how the model is initialized and used. I would probably start by looking for a “main” or “train” function first. Once this is done, you could then try to rip out the model and use it in your own custom script.</p>

username: Eta_C
cooked: <p>BTW, <strong>DONOT</strong> forget <code>torch.no_grad()</code> and <code>model.eval()</code></p>

username: MACHOCAPTCHA
cooked: <p>Thank you for your reply! I was busy for a while and could not continue my studies in this direction. Now I am here and would like to ask if there is already a more detailed discussion or article. Which says how can I use a ready-made neural network step by step?</p>

username: MACHOCAPTCHA
cooked: <p>Unfortunately, so far I don’t know what it says. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=10" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

username: my3bikaht
cooked: <p>Come on, there is even inference notebook attached <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=10" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p><aside class="onebox githubblob" data-onebox-src="https://github.com/OniroAI/MonoDepth-PyTorch/blob/master/Monodepth.ipynb">
  <header class="source">

      <a href="https://github.com/OniroAI/MonoDepth-PyTorch/blob/master/Monodepth.ipynb" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/OniroAI/MonoDepth-PyTorch/blob/master/Monodepth.ipynb" target="_blank" rel="noopener nofollow ugc">OniroAI/MonoDepth-PyTorch/blob/master/Monodepth.ipynb</a></h4>


    <pre><code class="lang-ipynb">{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import torch\n",
    "import numpy as np\n",
    "import skimage.transform\n",
    "import matplotlib.pyplot as plt\n",
    "from easydict import EasyDict as edict\n",
    "\n",
    "from main_monodepth_pytorch import Model\n",
    "%reload_ext autoreload\n",
    "%autoreload 2"
   ]
  },
</code></pre>


  This file has been truncated. <a href="https://github.com/OniroAI/MonoDepth-PyTorch/blob/master/Monodepth.ipynb" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


username: MACHOCAPTCHA
cooked: <aside class="quote no-group" data-username="my3bikaht" data-post="6" data-topic="137620">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/50afbb/48.png" class="avatar"> my3bikaht:</div>
<blockquote>
<pre><code class="lang-auto">    "%reload_ext autoreload\n",
    "%autoreload 2"
</code></pre>
</blockquote>
</aside>
<p>I have an error with these lines, I don’t know if I need them. The error sounds like: unexpected token ‘%’</p>

username: my3bikaht
cooked: <p>These are commands for IPython (if you’re running script using Jupyter)</p>

username: MACHOCAPTCHA
cooked: <p>thank you! I got it. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=10" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>