MuhammadTaha / Predictive-Analysis

1 stars 0 forks source link

`AbstractForecaster.save()` gives TypeError: can't pickle _thread.lock objects #9

Closed nielsrolf closed 6 years ago

nielsrolf commented 6 years ago

Therefore I will decomment that line in the next commit, but that doesn't fix it.

File "/home/niels/Dokumente/Informatik/Master/semantic-search/Predictive-Analysis/src/visualize.py", line 122, in visualize_linear_dependencies
    model.save()
  File "/home/niels/Dokumente/Informatik/Master/semantic-search/Predictive-Analysis/src/forecaster.py", line 194, in save
    plt.savefig(self.plot_dir+"/training.png")
  File "/home/niels/Dokumente/Informatik/Master/semantic-search/Predictive-Analysis/src/forecaster.py", line 94, in save

  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 484, in dump
    NumpyPickler(f, protocol=protocol).dump(value)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 409, in dump
    self.save(obj)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/home/niels/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 281, in save
    return Pickler.save(self, obj)
  File "/home/niels/anaconda3/lib/python3.6/pickle.py", line 496, in save
    rv = reduce(self.proto)
TypeError: can't pickle _thread.lock objects