title: RuntimeError: Attempting to deserialize object on a CUDA device
body: <p>I encounter a <code>RunTimeError</code> while I am trying to run the code in my machine's CPU instead of GPU. The code is originally from this GitHub project - <a href="https://github.com/CSAILVision/IBD" rel="noreferrer">IBD: Interpretable Basis Decomposition for Visual Explanation</a>. This is for a research project. I tried putting the CUDA as <code>false</code> and looked at other solutions on this website. </p>
  
  <pre><code>GPU = False               # running on GPU is highly suggested
  CLEAN = False             # set to "True" if you want to clean the temporary large files after generating result
  APP = "classification"    # Do not change! mode choide: "classification", "imagecap", "vqa". Currently "imagecap" and "vqa" are not supported.
  CATAGORIES = ["object", "part"]   # Do not change! concept categories that are chosen to detect: "object", "part", "scene", "material", "texture", "color"
  
  CAM_THRESHOLD = 0.5                 # the threshold used for CAM visualization
  FONT_PATH = "components/font.ttc"   # font file path
  FONT_SIZE = 26                      # font size
  SEG_RESOLUTION = 7                  # the resolution of cam map
  BASIS_NUM = 7                       # In decomposition, this is to decide how many concepts are used to interpret the weight vector of a class.
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 22, in &lt;module&gt;
      model = loadmodel()
    File "/home/joshuayun/Desktop/IBD/loader/model_loader.py", line 48, in loadmodel
      checkpoint = torch.load(settings.MODEL_FILE)
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 387, in load
      return _load(f, map_location, pickle_module, **pickle_load_args)
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 574, in _load
      result = unpickler.load()
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 537, in persistent_load
      deserialized_objects[root_key] = restore_location(obj, location)
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 119, in default_restore_location
      result = fn(storage, location)
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 95, in _cuda_deserialize
      device = validate_cuda_device(location)
    File "/home/joshuayun/.local/lib/python3.6/site-packages/torch/serialization.py", line 79, in validate_cuda_device
      raise RuntimeError('Attempting to deserialize object on a CUDA '
  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='cpu' to map your storages to the CPU.
  </code></pre>