Object detection FineTuning Tutorial

TidelyPom: <p>I have tried to run the script from the tutorial above and I get a crash in Python on line 13</p>
<p>from engine import train_one_epoch, evaluate</p>
<p>The error message is "ImportError: No module named ‘engine’ "</p>
<p>It looks like I forgot something but I can’t find the said module in Pytorch, can somebody tell me what I am doing wrong ?</p>

ptrblck: <p>This error seems to come from an older <code>torchvision</code> version.<br>
Could you update <code>torchvision</code> to <code>&gt;=0.3.0</code>?</p>

TidelyPom: <p>The version I have is 0.3.0, PyTorch is 1.1.0 but I can’t use CUDA (no GPU)</p>

ptrblck: <p>Yeah, you were right. You cannot simply import this methods without copying some files first.<br>
From the <a href="https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html#putting-everything-together">tutorial</a>:</p>
<blockquote>
<p>In <code>references/detection/</code> , we have a number of helper functions to simplify training and evaluating detection models. Here, we will use <code>references/detection/engine.py</code> , <code>references/detection/utils.py</code> and <code>references/detection/transforms.py</code> . Just copy them to your folder and use them here.</p>
</blockquote>

TidelyPom: <p>Thanks for the reply, I got it to work, just need to add in the directory coco_utils.py and coco_eval.py from the same directory, and to install pycocotools as well.</p>

swathi_pai: <p>after all these, the next error is on annotations,<br>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/cocodataset/cocoapi/issues/191" target="_blank" rel="nofollow noopener">github.com/cocodataset/cocoapi</a>
  </header>
  <article class="onebox-body">
    <a href="https://github.com/temptitle" rel="nofollow noopener">
<img src="https://avatars1.githubusercontent.com/u/36921178?v=2&amp;s=96" class="thumbnail onebox-avatar" width="60" height="60">
</a>

<h4><a href="https://github.com/cocodataset/cocoapi/issues/191" target="_blank" rel="nofollow noopener">Issue:  [Errno 2] No such file or directory: '../annotations/instances_val2017.json'</a></h4>

<div class="date" style="margin-top:10px;">
	<div class="user" style="margin-top:10px;">
	opened by <a href="https://github.com/temptitle" target="_blank" rel="nofollow noopener">temptitle</a>
	on <a href="https://github.com/cocodataset/cocoapi/issues/191" target="_blank" rel="nofollow noopener">2018-07-11</a>
	</div>
	<div class="user">
	</div>
</div>

<pre class="content" style="white-space: pre-wrap;">First of all , I'm new in machine learning and just tried to launch COCO data set using demo but receiving...</pre>

<div class="labels">
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>
<p>any solution?</p>

HIT-Owen: <p>Where can I find these files: <code>references/detection/engine.py</code> ,  <code>references/detection/utils.py</code>  and  <code>references/detection/transforms.py</code>?     Thank you very much!</p>

loerbri1: <p>Seems like engine.py requires a module called ‘coco_utils’</p>
<p>Could you tell us where we can find it or how we can install it?</p>

ptrblck: <p><code>coco_utils</code> should be part of the <code>cocoapi</code> and can be installed via:</p>
<pre><code class="lang-python">git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install
</code></pre>

mw-ding: <p><code>coco_utils</code> and <code>coco_eval</code> are actually in the <code>reference/detection/</code> folder as well.<br>
Both of them can be found at <a href="https://github.com/pytorch/vision/tree/master/references/detection" rel="nofollow noopener">https://github.com/pytorch/vision/tree/master/references/detection</a></p>

kl_divergence: <p>You can refer to <a href="https://github.com/prajjwal1/autonomous-object-detection" rel="nofollow noopener">this</a> repo as well. It is based on torchvision&gt;=0.3.</p>