Skip to content

Instantly share code, notes, and snippets.

@beckdaniel
Created November 30, 2015 16:13
Show Gist options
  • Save beckdaniel/b24e4ed6496f1e58e550 to your computer and use it in GitHub Desktop.
Save beckdaniel/b24e4ed6496f1e58e550 to your computer and use it in GitHub Desktop.
Bug in optimize_restarts
Python 2.7.10 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 18:04:42)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import numpy as np
In [2]: import GPy
In [3]:
In [3]: data = np.random.random(size=(10,5))
In [4]: model = GPy.models.GPRegression(data[:, :-1], data[:, -1:])
In [5]: model.optimize_restarts(parallel=True)
---------------------------------------------------------------------------
PicklingError Traceback (most recent call last)
<ipython-input-5-7185755ecc2d> in <module>()
----> 1 model.optimize_restarts(parallel=True)
/home/dbeck/anaconda2/lib/python2.7/site-packages/paramz/model.pyc in optimize_restarts
(self, num_restarts, robust, verbose, parallel, num_processes, **kwargs)
179 print(("Warning - optimization restart {0}/{1} failed".form
at(i + 1, num_restarts)))
180 else:
--> 181 raise e
182
183 if len(self.optimization_runs):
PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function fa
iled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment