<p dir="auto">I am building my model and storing it at a location using<br>
<code class="notranslate">joblib.dump(model, modelStoreLocation, compress=9)</code></p>
<p dir="auto">Then in a separate execution I am trying to read the model from the location as show below :<br>
<code class="notranslate">#  loading the model stored on disk model = joblib.load(modelStoreLocation)</code></p>
<p dir="auto">I get the following error :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  File &quot;/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py&quot;, line 84, in &lt;module&gt;x
    prediction = predictDataFrame(dataFrame.ix[600:623, :-1].values, modelStoreLocation)
  File &quot;/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py&quot;, line 58, in predictDataFrame
    prediction = model.predict(dataToPredict)
  File &quot;/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py&quot;, line 223, in predict
    scores = self.decision_function(X)
  File &quot;/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py&quot;, line 207, in decision_function
    dense_output=True) + self.intercept_
  File &quot;/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py&quot;, line 83, in safe_sparse_dot
    return np.dot(a, b)
TypeError: can't multiply sequence by non-int of type 'float'`
"><pre lang="Traceback" class="notranslate"><code class="notranslate">  File "/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py", line 84, in &lt;module&gt;x
    prediction = predictDataFrame(dataFrame.ix[600:623, :-1].values, modelStoreLocation)
  File "/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py", line 58, in predictDataFrame
    prediction = model.predict(dataToPredict)
  File "/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 223, in predict
    scores = self.decision_function(X)
  File "/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 207, in decision_function
    dense_output=True) + self.intercept_
  File "/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py", line 83, in safe_sparse_dot
    return np.dot(a, b)
TypeError: can't multiply sequence by non-int of type 'float'`

</code></pre></div>
<p dir="auto">The same works with out any problem when its in the same execution i.e. build the model , write to dsik and read from disk in the same execution.</p>
<p dir="auto">What is the fix for this ?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto">I am building my model and storing it at a location using<br>
<code class="notranslate">joblib.dump(model, modelStoreLocation, compress=9)</code></p>
<p dir="auto">Then in a separate execution I am trying to read the model from the location as show below :<br>
<code class="notranslate"># loading the model stored on disk model = joblib.load(modelStoreLocation)</code></p>
<p dir="auto">I get the following error :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File &quot;/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py&quot;, line 84, in &lt;module&gt;x
prediction = predictDataFrame(dataFrame.ix[600:623, :-1].values, modelStoreLocation)
File &quot;/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py&quot;, line 58, in predictDataFrame
prediction = model.predict(dataToPredict)
File &quot;/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py&quot;, line 223, in predict
scores = self.decision_function(X)
File &quot;/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py&quot;, line 207, in decision_function
dense_output=True) + self.intercept_
File &quot;/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py&quot;, line 83, in safe_sparse_dot
return np.dot(a, b)
TypeError: can't multiply sequence by non-int of type 'float'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py", line 84, in &lt;module&gt;x
prediction = predictDataFrame(dataFrame.ix[600:623, :-1].values, modelStoreLocation)
File "/Users/venuktangirala/PycharmProjects/nFlate/compute/prediction/categories/logisticRegression.py", line 58, in predictDataFrame
prediction = model.predict(dataToPredict)
File "/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 223, in predict
scores = self.decision_function(X)
File "/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 207, in decision_function
dense_output=True) + self.intercept_
File "/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py", line 83, in safe_sparse_dot
return np.dot(a, b)
TypeError: can't multiply sequence by non-int of type 'float'
</code></pre></div>
<p dir="auto">The same works with out any problem when its in the same execution i.e. build the model , write to dsik and read from disk in the same execution.</p>
<p dir="auto">What is the fix for this ?</p>