title: Caffe | Check failed: error == cudaSuccess (2 vs. 0) out of memory
body: <p>I am trying to train a network on Caffe. I have image size of 512x640. Batch size is 1. I'm trying to implement <a href="https://gist.github.com/shelhamer/91eece041c19ff8968ee" rel="noreferrer">FCN-8s</a>. </p>
  
  <p>I am currently running this on a Amazon EC2 instance (g2.2xlarge) with 4GB of GPU memory. But when I run the solver, it immediately throws out an error</p>
  
  <blockquote>
  <pre><code>Check failed: error == cudaSuccess (2 vs. 0)  out of memory
  *** Check failure stack trace: ***
  Aborted (core dumped)
  </code></pre>
  </blockquote>
  
  <p>Can someone help me proceed from here?</p>