title: How to use PyTorch multiprocessing?
body: <p>I'm trying to use python's multiprocessing <code>Pool</code> method in <code>pytorch</code> to process a image. Here's the code:</p>
  
  <pre><code>from multiprocessing import Process, Pool
  from torch.autograd import Variable
  import numpy as np
  from scipy.ndimage import zoom
  
  def get_pred(args):
  
    img = args[0]
    scale = args[1]
    scales = args[2]
    img_scale = zoom(img.numpy(),
                       (1., 1., scale, scale),
                       order=1,
                       prefilter=False,
                       mode='nearest')
  
    # feed input data
    input_img = Variable(torch.from_numpy(img_scale),
                       volatile=True).cuda()
    return input_img
  
  scales = [1,2,3,4,5]
  scale_list = []
  for scale in scales: 
      scale_list.append([img,scale,scales])
  multi_pool = Pool(processes=5)
  predictions = multi_pool.map(get_pred,scale_list)
  multi_pool.close() 
  multi_pool.join()
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>`RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method
  </code></pre>
  
  <p>`
  In this line:</p>
  
  <pre><code>predictions = multi_pool.map(get_pred,scale_list)
  </code></pre>
  
  <p>Can anyone tell me what I'm doing wrong ?</p>