title: Loaded model receives different prediction compared to saved model
body: <p>I am trying to save a model and load it into a different session, but I am having prediction inconsistencies, and I would appreciate any help that can be offered. So here is what I did...</p>
  
  <p>First, after running the model, I used this code to save the model:</p>
  
  <pre><code>from sklearn.externals import joblib
  joblib.dump(clf, "models.pkl")
  </code></pre>
  
  <p>and then to load the file in a different colaboratory notebook, I used the function </p>
  
  <pre><code>from sklearn.externals import joblib
  loaded_model = joblib.load('models.pkl')
  </code></pre>
  
  <p>then the program I used to process a single image for testing </p>
  
  <pre><code>img_toArray = cv2.imread("/content/ESD/ESD/folder1/img1.png")
  new_array = cv2.resize(img_toArray, (220, 220))
  new_array = np.array(new_array).reshape(1,145200)
  </code></pre>
  
  <p>but this results in an output of array([4]) with every image I test, and I am not sure why.</p>
  
  <p>I have also tried to reload the entire dataset again and separate the labels from the features (the image), and use train_test_split to dedicate 90% of the dataset for testing, and when I run the features (images) to test with, through the block of code:</p>
  
  <pre><code>loaded_model.predict(np.array(xTest[whatEverNumber]).reshape(1,145200))
  </code></pre>
  
  <p>I get the right predictions. So I am confused as to what I a doing wrong, because in both examples,I am processing the images in basically the same method, and then separating the images and running them through the same prediction method. So I would appreciate any help in figuring out what I did wrong.</p>
  
  <p>Extra information that may prove beneficial: I am using colaboratory and my model is an sklearn SVM that runs through a cross_validation_predict, cross_validation_predict, and finally an SVM fit function. </p>
  
  <p>Thank you in advance!</p>