title: please use torch.load with map_location=torch.device('cpu')
body: <p>I am running Python program, but I do not have a GPU, what can I do to make Python use CPU instead of GPU?</p>
  <pre class="lang-sh prettyprint-override"><code>$ python extract_feature.py --data mnist --net checkpoint_4.pth.tar --features pretrained
  </code></pre>
  <p>It gives me the following warning:</p>
  <blockquote>
  <p>=&gt; RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.</p>
  </blockquote>
  <p>The photo is the Structure of my Python project:</p>
  <p><a href="https://i.stack.imgur.com/HqD45.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HqD45.png" alt="1" /></a></p>