For some reason when I set model.cuda() along with the other examples I get the following error:
*** Error in `python’: free(): invalid pointer: 0x00007f8af6c2bae0 ***
However when I no longer set model.cuda() I get no pointer free errors and the model trains fine. Do I have to set .cuda() on every single variable including the criterion?
I am using python2 and using the Udacity Tensorflow g2.2xlarge instance on Amazon AWS.
Here is a link to my code:

  
      github.com
  
  
    sujithv28/Deep-LeafSnap/blob/master/model.py 129
import argparse
import cv2
import json
import numpy as np
import os
import pandas as pd
import scipy.misc
import shutil
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim as optim
import torchvision
import torchvision.models as models
import utils

from PIL import Image


  This file has been truncated. show original

  
  
    
    
  
  


Thank you!